Using create_package within an interactive session but outside of the RStudio console gives a misleading error message. Note the change of directory is successful even though the error message would indicate the folder does not exist. This error message does not appear when using RStudio.
R> getwd()
[1] "/home/tim"
R> usethis::create_package("test")
✔ Creating 'test/'
✔ Setting active project to '/home/tim/test'
✔ Creating 'R/'
✔ Writing 'DESCRIPTION'
Package: test
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
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.0
✔ Writing 'NAMESPACE'
✔ Changing working directory to 'test/'
Error: Directory 'test' does not exist.
Run `rlang::last_error()` to see where the error occurred.
✔ Setting active project to '<no active project>'
R> getwd()
[1] "/home/tim/test"
R> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Tumbleweed
Matrix products: default
BLAS: /usr/lib64/R/lib/libRblas.so
LAPACK: /usr/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_2.3.0 usethis_1.6.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 rstudioapi_0.11 xml2_1.3.2 knitr_1.28
[5] magrittr_1.5 roxygen2_7.1.0 pkgload_1.0.2 R6_2.4.1
[9] rlang_0.4.5 fansi_0.4.1 stringr_1.4.0 tools_4.0.0
[13] pkgbuild_1.0.7 xfun_0.13 sessioninfo_1.1.1 cli_2.0.2
[17] git2r_0.26.1 withr_2.2.0 ellipsis_0.3.0 remotes_2.1.1
[21] assertthat_0.2.1 digest_0.6.25 rprojroot_1.3-2 crayon_1.3.4
[25] processx_3.4.2 purrr_0.3.4 callr_3.4.3 fs_1.4.1
[29] ps_1.3.2 testthat_2.3.2 memoise_1.1.0 glue_1.4.0
[33] stringi_1.4.6 compiler_4.0.0 desc_1.2.0 backports_1.1.6
[37] prettyunits_1.1.1
Using
create_packagewithin an interactive session but outside of the RStudio console gives a misleading error message. Note the change of directory is successful even though the error message would indicate the folder does not exist. This error message does not appear when using RStudio.