
Scaffold a Reproducible Analytical Pipeline Project
Source:R/sus_rap_template.R
sus_rap_template.RdCreates a ready-to-use project directory with a _targets.R pipeline,
a parameterised Quarto report, optional renv dependency snapshot,
optional GitHub Actions CI workflow, and a structured file layout
following RAP best practices.
Usage
sus_rap_template(
path,
name,
system = "SIM-DO",
include_renv = TRUE,
include_targets = TRUE,
include_quarto = TRUE,
include_github_actions = FALSE,
lang = "pt"
)Arguments
- path
character(1)- Parent directory where<name>/will be created (e.g."~/projetos").- name
character(1)- Project name; becomes the directory name.- system
character(1)- DATASUS system for the template pipeline (e.g."SIM-DO","SINAN","SIH"). Default"SIM-DO".- include_renv
logical(1)- Initialiserenvfor dependency management. Requires therenvpackage. DefaultTRUE.- include_targets
logical(1)- Create_targets.Randrun.R. DefaultTRUE.- include_quarto
logical(1)- Createanalysis.qmd. DefaultTRUE.- include_github_actions
logical(1)- Create.github/workflows/rap.yml. DefaultFALSE.- lang
character(1)- Language for generated comments and messages:"pt"(default),"en", or"es".
Generated structure
<name>/
|-- _targets.R # targets pipeline
|-- run.R # convenience runner: source + tar_make()
|-- analysis.qmd # parameterised Quarto report
|-- R/
| `-- functions.R # custom analysis functions
|-- data/ # raw data (git-ignored)
|-- output/ # results (git-ignored)
|-- renv/ # renv library (when include_renv = TRUE)
|-- renv.lock
|-- .gitignore
`-- README.md