
Create a new CSAS document based on a template
draft.RdCreate a draft of an R Markdown CSAS document.
Usage
draft(
type = c("resdoc", "fsar", "sr", "techreport", "manureport", "datareport"),
directory = ".",
edit = FALSE,
create_rstudio_project = TRUE,
...
)Arguments
- type
The type of document to draft. Must be one of
resdoc,fsar,sr,techreport,manureportordatareport.- directory
The directory to place the draft document files. Current directory by default
- edit
TRUEto edit the template immediately.- create_rstudio_project
TRUEto create an RStudio project file.- ...
Other arguments to pass to
rmarkdown::draft().
Details
This is a light wrapper around rmarkdown::draft(). Consult that
function for further details.
Examples
# \donttest{
# create a temporary example folder:
wd <- getwd()
example_path <- file.path(tempdir(), "csasdown-example")
dir.create(example_path)
setwd(example_path)
# create a draft template:
csasdown::draft("resdoc")
#> ✔ Drafting a new resdoc project
#> ✔ Created .gitignore file
#> ✔ Created .here file
#> ✔ Created RStudio project file: csasdown-example.Rproj
# return to original working directory after running example:
setwd(wd)
# clean up:
unlink(example_path, recursive = TRUE, force = TRUE)
# }