6 projrsimple
I’ve written a simple package to help you:
- initialise your projects (directories, Git, GitHub and a README), and
- build your projects (Quarto, R Markdown, and R scripts) in a clean and easy way.
There are only two functions in this package:
projr_init: Initialises a project with relevant directories, Git and GitHub.projr_run: Runs all scripts in the project (.R,.Rmd,.qmdorQuartoprojects).
What problems does it help solve?
- Avoiding having to remember the commands to initialise a project.
- Running all the scripts in a project in the correct order.
- Copies all rendered documents to a
docsdirectory. - (Optionally) ensuring a clean
outputdirectory before running the scripts.
6.1 Installation
You can install the package from GitHub using the following code:
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_github("MiguelRodo/projrsimple")6.2 Usage
- Install
projrsimple(see above). - Open an R session in your project directory (folder where you want to work).
- Run
projr_init()to initialise your project (set up Git, GitHub, project directories and a README; simpler than the other instructions for doing this). - Write code in scripts (
.R,.Rmd,.qmdand/or Quarto projects) in the project directory. - Run
projr_runto execute all scripts. Within those scripts, save outputs to_outputdirectory. - View rendered documents in the
docsdirectory.
See the package website for more information: projrsimple.