prodigenr, or project directory generator, was designed to simplify the process of creating new data analysis projects and to help make your workflow more reproducible from the beginning. Standard files and folders are created for specific projects (e.g. abstracts or manuscripts). While creating individual folders and files manually for new projects doesn’t take too much time, over time and over many researchers, this can quickly add up to a lot of time! Plus, when a standard structure is followed it makes it easier to share code and establish reproducible practices earlier on in the project.
Starting a research project? Create a project directory like so:
library(prodigenr) # Create a temporary folder using the fs package <- fs::path_temp("HeartDiseaseExercise") new_project_path setup_project(new_project_path)
Or via RStudio’s interface (with RStudio version >1.1):
The resulting file structure should look something like this:
HeartDiseaseExercise ├── DESCRIPTION ├── HeartDiseaseExercise.Rproj ├── R │ └── README.md ├── README.md ├── TODO.md ├── data │ └── README.md ├── data-raw │ └── README.md └── doc └── README.md
README.md files are contained within each project and in each folder that explains a bit more about what each folder and file are used for, which is briefly described here:
R/: Should contain the R scripts and functions used for the analysis.
doc/: Should contain the files related to presenting the project’s scientific output (e.g. manuscript).
data/: If relevant, is where the processed (or simulated) data is kept that is used for the project as well as the results of the project’s analyses.
data-raw/: If relevant, is where the scripts that process the raw data into the usable data are kept and, optionally where the raw data is also kept.
DESCRIPTION: Is a standard file that includes metadata about your project, in a machine readable format, and that also stores a list of the R packages your project depends on.
.Rproj: Is a standard file used by RStudio to set some R Project specific settings.
To add a new document (e.g. slides, manuscript), run any of the
create_*() commands (e.g.
create_manuscript()) in the console while in RStudio in the newly created project (via the
# you need to run these in the project's console create_manuscript() create_slides()
#> ✓ Creating a 'report' file in the 'doc/' folder. #> ✓ Creating a 'slides' file in the 'doc/' folder.
Now two more files have been added to the
doc/ folder. The resulting file structure should look something like this:
HeartDiseaseExercise ├── DESCRIPTION ├── HeartDiseaseExercise.Rproj ├── R │ └── README.md ├── README.md ├── TODO.md ├── data │ └── README.md ├── data-raw │ └── README.md └── doc ├── README.md ├── report.Rmd └── slides.Rmd
At present, there are only two template files that you can view:
template_list#>  "report" "slides"
The end goal of each project is to be as self contained as possible. So that if you ever need to go back to the analysis, it is easy to re-run the code and get the results that you say you got. This is especially useful if others such as reviewers ask for something or want to confirm your results. See the manifesto for more details on the underlying philosophy behind this package.