Why and How to Include a Vignette in Your R Package

Поділитися
Вставка

КОМЕНТАРІ • 11

  • @dasrotrad
    @dasrotrad 3 роки тому +2

    What an amazing improvement in audio. That is excellent audio Wolf. I don’t think it gets any better than this. Others need to take lessons from you on the audio alone. Thank you. I am enjoying your presentations. This improvement is going to make it so much better.

    • @StatistikinDD
      @StatistikinDD  3 роки тому

      Really? I'm not sure about this one, actually I wondered if I could dare to publish it. The recorded volume was very low. Glad if you could understand it well! Thanks for your feedback, Robert!

  • @alvaroignaciotapia
    @alvaroignaciotapia Рік тому

    Thanks for this brillian tutotial, I have a quesstion though: is it ok that I save the generated .tar file in my R package directory on my Desktop? Before ubmitting to CRAN. Because I assume that if I save the .tar file elsewhere, and submit my directory to CRAN, the vignette won't come up on the help tab, right? THANKS!

    • @StatistikinDD
      @StatistikinDD  Рік тому

      Hi, thanks for your feedback!
      For CRAN submission, you upload a tar.gz file to CRAN, which contains the vignette.
      From the R Packages book at r-pkgs.org/vignettes.html#sec-vignettes-how-built-checked
      Prepare built vignettes for a CRAN submission: Don’t try to do this by hand or in advance. Allow vignette (re-)building to happen as part of devtools::submit_cran() or devtools::release(), both of which build the package.

  • @briandong5293
    @briandong5293 2 роки тому

    Hmm. I had a vignette that I put into a vignette directory and Its not appearing after I build the package and bring it back in as .tar. Not sure what the reason is.

    • @StatistikinDD
      @StatistikinDD  2 роки тому

      Hi Brian, did you use usethis::use_vignette() to get started? It does more than creating a vignette subdirectory. Also adds dependencies to DESCRIPTION, fills the VignetteBuilder field and drafts the vignette in Markdown format.
      Building vignettes is somewhat complicated "since the official tooling basically treats vignettes somewhat like tests, instead of documentation" (quoted from r-pkgs.org/vignettes.html#sec-vignettes-how-built-checked).
      One way is to install from github:
      devtools::install_github(dependencies = TRUE, build_vignettes = TRUE)
      Install locally:
      devtools::install(dependencies = TRUE, build_vignettes = TRUE)

    • @briandong5293
      @briandong5293 2 роки тому

      @@StatistikinDD Yes, I tried usethis::use_vignette() this time and I ended up getting a problem when I searched for the vignette with help()
      URL '/help/library/covidpackage_vignette/html/00Index.html' not found
      covidpackage_vignette was the name of my vignette file.

    • @StatistikinDD
      @StatistikinDD  2 роки тому

      @@briandong5293 How did you install the package?
      Install and Restart does NOT build vignettes. Neither does devtools::install_github(), unless you explicitly specify the build_vignettes = TRUE parameter.
      You can use devtools::build() to create a package bundle including vignettes, and install locally.
      To check whether your package contains the vignette(s), you can have a look at help(package = yourpackage). That should display a help page linking to the DESCRIPTION and the functions and data (if present), and contain a link to the vignettes (if present).

    • @briandong5293
      @briandong5293 2 роки тому

      @@StatistikinDD I did use build source package and then detached and installed the .tar.gz. I saw ** installing vignettes in the console. My vignette is in the bundled package though just not under the descriptions.

  • @nassimzbalah1623
    @nassimzbalah1623 2 роки тому

    Hello, little question : is it possible to submit a R package to CRAN without any vignettes and examples ? I keep getting this warning message : "checking for code which exercises the package ... WARNING
    No examples, no tests, no vignettes".
    Thank you !

    • @StatistikinDD
      @StatistikinDD  2 роки тому

      Many packages don't have vignettes.
      I believe CRAN expects warnings to be fixed, so code examples can probably not be avoided.