Create a clinical research project with a standardized structure:
├── main.R
├── NEWS.md
├── README.md
└── my_proj.Rproj
├── R
│ ├── init.R
│ ├── read.R
│ ├── check.R
│ ├── description.R
│ ├── population.R
│ ├── graph.R
│ └── report.R
Arguments
- path
Destination directory for the project root. Will be created if needed.
- ...
Dots are ignored. Reserved for future extensions.
- trial_name
The abbreviated name of the trial.
- headers
Optional key–value headers to inject at the top of created files
- open
If
TRUE, opens the new project in RStudio.- verbose
If
TRUE, print diagnostics.
Structure
At the root of the project:
README.md: short project descriptionNEWS.md: version logmain.R: central script that orchestrates the workflow<project>.Rproj: RStudio project
In the R folder:
init.R: packages loading and global optionsread.R: data import and global variablespopulation.R: protocol populationsFiles ranging from
09_xxxto15_xxxhold your analysescheck.R: data checks (e.g.,edc_data_warn())report.R: report generation (e.g.,{{officer}})
Examples
if (FALSE) { # \dontrun{
headers = c("Statistician"="Dan",
"Creation date"="2025-01-01")
gr_new_project(headers=headers, trial_name="MYSTUDY")
} # }