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)



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


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


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


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 for more details that motivated this function.


## Create an example temporary package for illustrative purposes
pkgdir <- biocthis_example_pkg()
#>  Setting active project to '/tmp/RtmpTHfQjN/biocthisexample'
#> Package: biocthisexample
#> Title: What the Package Does (One Line, Title Case)
#> Version:
#> Authors@R (parsed):
#>     * First Last <> [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.2.3
#>  Setting active project to '/tmp/RtmpTHfQjN/biocthisexample'