Skip to content

Workflow

fw_project

Find the project and set path globals

fw_project walks up from the current folder, at most 10 levels, to the first folder with .framework/, settings.yml, config.yml, or settings.do. It reads the project settings and sets a global for each project folder.

Global Value
$fw_root The project folder
$fw_key Each folder in directories, such as $fw_inputs_raw
$fw_data The data folder, else inputs_final, else inputs_public_final, when the settings have one, even before it exists
$fw_outputs The outputs folder, when it exists
$fw_project_name The project name

Usage

fw_project [, root(folder) quietly]

Options

Name Description
root(folder)

Starts the search in folder rather than the current folder.

quietly

Skips the summary.

Value

  • r(root): the project folder
  • r(name): the project name
  • r(folders): the folder keys

Details

Paths are absolute and use forward slashes on every system. Globals from a previous project are cleared.

Settings come from settings.yml, with split files such as settings/data.yml and environment sections. The active environment is FW_CONFIG_ACTIVE, then R_CONFIG_ACTIVE, then R_CONFIG_NAME, then default. Projects that fw created for Stata keep their folders in settings.do; fw_project reads those too and leaves the globals of settings.do, such as $inputs_raw, untouched.

Other commands run fw_project themselves when no project is loaded. Run it again after you change to another project.

Examples

Not run

fw_project
use "$fw_inputs_raw/survey.dta", clear

Related reference