| make_script | R Documentation |
Convenience wrapper for make_notebook() that creates R scripts (.R files).
This is identical to calling make_notebook("name.R").
make_script(name, dir = NULL, stub = "default", overwrite = FALSE)
name |
Character. The script name (with or without .R extension). Examples: "process-data", "process-data.R" |
dir |
Character. Directory to create the script in. Uses your project's
configured |
stub |
Character. Name of the stub template to use. Defaults to
"default". User can create custom stubs in |
overwrite |
Logical. Whether to overwrite existing file. Default FALSE. |
This function is a convenience wrapper that:
Ensures the name ends with .R extension
Uses script_dir config option instead of notebook_dir
Calls make_notebook() with type = "script"
Scripts are created in the scripts/ directory by default:
scripts/ process-data.R build-features.R run-model.R
Invisible path to created script
make_notebook() for creating Quarto/RMarkdown notebooks
if (FALSE) {
# Create script (extension optional)
make_script("process-data")
make_script("process-data.R")
# Use custom stub
make_script("etl-pipeline", stub = "etl")
# Create in specific directory
make_script("analysis", dir = "analysis/")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.