create_rmarkdown() creates a complete example project structure for an R
Markdown analysis that uses the plnr framework. It creates a standardized
directory structure. It also creates example files that show how to use
plnr for data analysis and for report generation.
Details
The created project includes:
A main
run.Rscript that initializes the project and demonstratesplnrusageExample analysis functions in the
RdirectoryA template R Markdown document
Standard project directories (results, paper, raw)
See also
vignette("plnr") for the framework the generated run.R uses. That
run.R builds one Plan. It then makes one add_data() call, and one
add_analysis() call per output.
Examples
# \donttest{
# Create a temporary directory for the example
temp_dir <- tempfile("plnr_example_")
create_rmarkdown(temp_dir)
#> ✔ Setting active project to "/tmp/RtmptGEIBL/plnr_example_1b2c39335b74".
#> ✔ Writing a sentinel file .here.
#> ☐ Build robust paths within your project via `here::here()`.
#> ℹ Learn more at <https://here.r-lib.org>.
#> ✔ Setting active project to "<no active project>".
# View the created structure
list.files(temp_dir, recursive = TRUE)
#> [1] "R/figure_death.R" "R/table_death.R" "paper/paper.Rmd" "run.R"
unlink(temp_dir, recursive = TRUE)
# }
