View source: R/framework_util.R
| standardize_wd | R Documentation |
This function helps standardize the working directory when working with framework projects, especially useful in Quarto/RMarkdown documents that may be rendered from subdirectories.
standardize_wd(project_root = NULL)
project_root |
Character string specifying the project root directory. If NULL (default), the function will attempt to find it automatically. |
The function looks for common framework project indicators:
settings.yml or settings.yml file
.Rprofile file
Being in common subdirectories (scratch, work)
It sets both the regular working directory and knitr's root.dir option if knitr is available.
Invisibly returns the standardized project root path.
if (FALSE) {
library(framework)
standardize_wd()
scaffold()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.