proj_create_dir_target: Create target directory

View source: R/directories.R

proj_create_dir_targetR Documentation

Create target directory

Description

A target directory is dedicated to each RMarkdown file in a workflow. Call this function from within an RMarkdown file to create its target directory. If the directory already exists and clean is TRUE, it will be deleted then re-created.

Usage

proj_create_dir_target(name, clean = TRUE)

Arguments

name

character name of the workflow component.

clean

logical indicates to start with a clean (empty) directory.

Details

Following this workflow philosophy, the target directory is the only directory to which a RMarkdown directory should write. The exception to this is the last RMarkdown file in a workflow sequence, which may publish data elsewhere.

To establish the connection between the two, the target directory shall be named for the RMarkdown file itself. This is the purpose of the name argument; its value should be the name of the current workflow component, i.e. the name of the current Rmd file.

To make things a little easier, the template used by proj_workflow_use_rmd() includes a call to proj_create_dir_target(), with the name argument populated.

Value

Invisible NULL, called for side effects.

Examples

# not run because it creates side effects
## Not run: 
  proj_create_dir_target("01-clean")

## End(Not run)

ijlyttle/projthis documentation built on Aug. 18, 2022, 11:25 a.m.