This function creates a temporary example package. It is used by the functions in biocthis to illustrate the functionality of the package without exposing users to internals of usethis that users do not need to use under typical working conditions.

biocthis_example_pkg(name = "biocthisexample", use_git = FALSE)

Arguments

name

A character(1) with the name of the example package.

use_git

A logical(1) indicating whether to set up git through usethis::use_git() on the temporary example package.

Value

A character(1) with the path to a temporary example package to use in the examples of the biocthis functions.

Details

This function creates a package under tempdir() with the name provided and uses usethis::proj_set() for setting the project directory. Users do not need to rely on usethis::proj_set() under typical scenarios. In other words, if you are running R interactively, usethis will set the directory for you.

Check https://github.com/lcolladotor/biocthis/commit/dc387807623f0e945432d15f0d0f899de1b1dd9d#r39102094 for more details that motivated this function.

Examples


## Create an example temporary package for illustrative purposes
pkgdir <- biocthis_example_pkg()
#>  Setting active project to "/tmp/RtmpKDAe9y/biocthisexample".
#> 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]
#> 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.3.2
#>  Setting active project to "/tmp/RtmpKDAe9y/biocthisexample".