When inside RStudio desktop, I run
devtools::create('foobar', rstudio = FALSE)
I still get an RStudio project file inside the directory.
If I run
Rscript -e "devtools::create('foobaz')"
on my (Linux) terminal, then no project file is created.
It seems like rstudioapi::isAvailable()
is being run and if that gives TRUE (when inside RStudio desktop) or FALSE (when in the terminal) that determines whether I get the project file.
The devtools::create
calls usethis::create_package
and there we have an argument rstudio
. The help for that argument says
If TRUE, calls use_rstudio() to make the new package or project into an RStudio Project. If FALSE and a non-package project, a sentinel .here file is placed so that the directory can be recognized as a project by the here or rprojroot packages.
So why does
devtools::create('foobar', rstudio = FALSE)
give a project file?
I usually want a project file. But I want to understand if I am doing something wrong.