This function is very similar to usethis::use_vignette() except that it uses a template from biocthis. This template includes instructions for citing other packages using RefManageR, uses sessioninfo::session_info() for displaying the R session information since it includes GitHub installation information and other useful details. The template also includes a section on how to ask for help and required knowledge.

use_bioc_vignette(name, title = name)

Arguments

name

Just like in usethis::use_vignette(): base for file name to use for new vignette. Should consist only of numbers, letters, _ and -. Lower case is recommended.

title

Just like in usethis::use_vignette(): the title of the vignette.

Value

This function adds and/or replaces the vignettes/<name>.Rmd file in your R package.

Examples


if (FALSE) {
## Run this function in your package
pkg <- basename(usethis::proj_get())
biocthis::use_bioc_vignette(pkg, paste("Introduction to", pkg))
}

## Create an example package for illustrative purposes.
## Note: you do not need to run this for your own package!
pkgdir <- biocthis_example_pkg()
#> Package: biocthisexample
#> Title: What the Package Does (One Line, Title Case)
#> Version: 0.0.0.9000
#> Authors@R (parsed):
#>     * First Last <first.last@example.com> [aut, cre] (YOUR-ORCID-ID)
#> Description: What the package does (one paragraph).
#> License: `use_mit_license()`, `use_gpl3_license()` or friends to
#>     pick a license
#> Encoding: UTF-8
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 7.1.2

## Create a template vignette file that is Bioconductor-friendly
biocthis::use_bioc_vignette("biocthisexample", "Introduction to biocthisexample")
#>  Adding 'knitr' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("knitr", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `knitr::fun()` (replacing `fun()`).
#>  Adding 'BiocStyle' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("BiocStyle", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `BiocStyle::fun()` (replacing `fun()`).
#>  Adding 'RefManageR' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("RefManageR", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `RefManageR::fun()` (replacing `fun()`).
#>  Adding 'sessioninfo' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("sessioninfo", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `sessioninfo::fun()` (replacing `fun()`).
#>  Adding 'testthat' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("testthat", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `testthat::fun()` (replacing `fun()`).
#>  Setting VignetteBuilder field in DESCRIPTION to 'knitr'
#>  Adding 'inst/doc' to '.gitignore'
#>  Creating 'vignettes/'
#>  Adding '*.html', '*.R' to 'vignettes/.gitignore'
#>  Adding 'rmarkdown' to Suggests field in DESCRIPTION
#>  Use `requireNamespace("rmarkdown", quietly = TRUE)` to test if package is installed
#>  Then directly refer to functons like `rmarkdown::fun()` (replacing `fun()`).
#>  Writing 'vignettes/biocthisexample.Rmd'
#>  Edit 'vignettes/biocthisexample.Rmd'