standardize_wd: Standardize Working Directory for Framework Projects

View source: R/framework_util.R

standardize_wdR Documentation

Standardize Working Directory for Framework Projects

Description

This function helps standardize the working directory when working with framework projects, especially useful in Quarto/RMarkdown documents that may be rendered from subdirectories.

Usage

standardize_wd(project_root = NULL)

Arguments

project_root

Character string specifying the project root directory. If NULL (default), the function will attempt to find it automatically.

Details

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.

Value

Invisibly returns the standardized project root path.

Examples


if (FALSE) {
library(framework)
standardize_wd()
scaffold()
}



framework documentation built on Feb. 18, 2026, 1:07 a.m.