Two main files have been added to create the new function create_project().
R/create_project.R
inst/rstudio/templates/project/create_project.dcf
The first includes the function to create and populate a new R project. It includes several files and folders by default such as _analysis/analysis.qmd, a renv.lock and tests/. There are options that allow one to alter the structure of the project (for example for package development or a publication pipeline).
The second file provides the binding to create a GUI option to create the R project. This appear when one clicks the "New project" at the top right of the RStudio IDE.
Why are these changes being made?
These changes are being made as the solution for the issue - Pre-populated project template #70
Detailed description of changes
R/create_project.R added which is the main function to create the pre-populated project.
inst/rstudio/templates/project/create_project.dcf which builds the GUI to start the project.
Frederick logo added to above folder so it appears in the GUI.
Amended the Imports and Suggest in the DESCRIPTION file to facilitate create_project().
Test of basic functionality - does it create the folders and files we expect.
Test to see if the warning appears if {renv} is not installed.
devtools::check() has been re-run, creating the create_project() vignette.
The _pkgdown.yml has also been updated to include the new function.
Additional information for reviewers
A set of tests have been added, however these are not exhaustive and could include more.
Currently the init_renv parameter of the function is set to TRUE as default. This initiates {renv} in the created project, which is best practice. However, the renv.lock is setup to record several packages ({rmarkdown}, {testthat}, {renv}, {stringr}). There is a minor issue that these packages are not installed in the new project and so the message appears:
"- None of the packages recorded in the lockfile are currently installed."
This can be rectified by executing renv::restore() which will install those packages. These packages are needed to create the tests and run the Quarto file. They could be reviewed. Potentially the init_renv is set to FALSE so it is more optional but I think promoting {renv} is best practice.
More documentation will be necessary to describe and explain how the function work, especially the above.
The actual structure of the project created should also be reviewed, especially for the publication project pipeline option (I have just guessed this and assume there is an existing project template which would go better there).
Brief overview of changes
Two main files have been added to create the new function
create_project()
.R/create_project.R
inst/rstudio/templates/project/create_project.dcf
The first includes the function to create and populate a new R project. It includes several files and folders by default such as
_analysis/analysis.qmd
, arenv.lock
andtests/
. There are options that allow one to alter the structure of the project (for example for package development or a publication pipeline).The second file provides the binding to create a GUI option to create the R project. This appear when one clicks the "New project" at the top right of the RStudio IDE.
Why are these changes being made?
These changes are being made as the solution for the issue - Pre-populated project template #70
Detailed description of changes
R/create_project.R
added which is the main function to create the pre-populated project.inst/rstudio/templates/project/create_project.dcf
which builds the GUI to start the project.DESCRIPTION
file to facilitatecreate_project()
.{renv}
is not installed.devtools::check()
has been re-run, creating thecreate_project()
vignette.Additional information for reviewers
A set of tests have been added, however these are not exhaustive and could include more.
Currently the
init_renv
parameter of the function is set to TRUE as default. This initiates{renv}
in the created project, which is best practice. However, therenv.lock
is setup to record several packages ({rmarkdown}
,{testthat}
,{renv}
,{stringr}
). There is a minor issue that these packages are not installed in the new project and so the message appears:"- None of the packages recorded in the lockfile are currently installed."
This can be rectified by executing
renv::restore()
which will install those packages. These packages are needed to create the tests and run the Quarto file. They could be reviewed. Potentially theinit_renv
is set toFALSE
so it is more optional but I think promoting{renv}
is best practice.More documentation will be necessary to describe and explain how the function work, especially the above.
The actual structure of the project created should also be reviewed, especially for the publication project pipeline option (I have just guessed this and assume there is an existing project template which would go better there).
Issue ticket number/s and link
Pre-populated project template #70