SaintRod / multi-lang-project-template

A language agnostic data analysis project template
MIT License
1 stars 1 forks source link

Enhancements to R Project Setup #2

Closed jibarozzo closed 1 month ago

jibarozzo commented 1 month ago

Summary

This PR introduces changes to the R project setup process, with minimal changes to the base R environment. The enhancements are triggered when the -l r flag is passed during the project creation.

Changes

  1. Creation of .Rproj file: A .Rproj file is now created as a simple text file with default settings. This file is essential for RStudio to recognize the directory as an non-package R project.

  2. Integration with renv for dependency management: If the -l r flag is passed, the script checks if renv is installed. If not, it installs renv in the base R environment. It then runs renv::init(project = '$path') to create an renv.lock file and an renv folder. These are used to manage the R package dependencies for the project. If no path is specified, renv::init() sets the current directory as the project directory.

Notes

This is a basic setup for an R project. There are other alternatives for more comprehensive project setups, such as using the usethis package. Future enhancements could consider integrating usethis or other project management tools for R.

Testing

Please test this PR by creating a new R project with the -l r flag, as well as -l r -p "PATH/HERE", to verify that the .Rproj file,renv.lockfile, andrenv` folder are created in the desired directory.

SaintRod commented 1 month ago

Let's test the updates. If there are any issues we can open issues to track progress.

Thanks again @jibarozzo for your participation