Template for a general structure of a project
This template is a recommended structure for R projects which consists of modular codes with individual functions and purposes. The Config file is the single file where all variables, packages, criteria are defined. Operations are singled out in folders and R-codes.
├─ Data
| ├─ Input
| ├─ Processed
| └─ Temp
├─ Outputs
| ├─ Data
| ├─ Figures
| └─ Tables
├─ R
| ├─ ___Init_project___.R
| ├─ 00_Config_file.R
| ├─ 01_Data_processing
| ├─ 02_Main_analyses
| ├─ 03_Supplementary_analyses
| ├─ Functions
| └─ example_fc.R
├─ renv
| ├─ activate.R
| ├─ library
| ├─ settings.json
| └─ library_list.lock
├─ README.md
├─ LICENSE
└─ [project name].Rproj
The project is accessible in two ways:
-
If a user has a GitHub account, the easiest way is to clone this GitHub repo.
-
A user can download the latest Release of the project as a zip file from the Release page.
The R project consists of codes with individual scripts and functions. All scripts are stored in the R/
folder.
Once a user obtains their version of the project, there are several steps to be done before using it:
-
Update R and R-studio IDE. There are many guides on how to do so (e.g. here)
-
Execute all individual steps with the
___Init_project___.R
script. This will result in the preparation of all R-packages using the{renv}
package, which is an R dependency management of your projects. Mainly it will install{RUtilpol}
and all dependencies.{RUtilpol}
is used throughout the project as a version control of files.