dfe-analytical-services / dfeR

Common R tasks in the Department for Education (DfE)
https://dfe-analytical-services.github.io/dfeR/
GNU General Public License v3.0
8 stars 2 forks source link

create_project() #71

Open JT-39 opened 1 month ago

JT-39 commented 1 month ago

Brief overview of changes

Two main files have been added to create the new function create_project().

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

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).

Issue ticket number/s and link

Pre-populated project template #70

chfoster commented 1 week ago

Don't think this error message is necessarily right: image

cjrace commented 5 days ago

Jake Tufts PR review