wflow_status reports the analysis files that require user action.

wflow_status(files = NULL, project = ".")

Arguments

files

character (default: NULL) The analysis file(s) to report the status. By default checks the status of all analysis files. Supports file globbing.

project

character (default: ".") By default the function assumes the current working directory is within the project. If this is not true, you'll need to provide the path to the project directory.

Value

Returns an object of class wflow_status, which is a list with the following elements:

  • root: The relative path to the root directory of the workflowr project (i.e. contains the RStudio .Rproj file).

  • analysis: The relative path to the directory that contains _site.yml and the R Markdown files.

  • docs: The relative path to the directory that contains the HTML files and figures.

  • git: The relative path to the .git directory that contains the history of the Git repository.

  • site_yml: TRUE if the configuration file _site.yml has uncommitted changes, otherwise FALSE.

  • wflow_yml: TRUE if the configuration file _workflowr.yml has uncommitted changes, otherwise FALSE. If the file does not exist, the result is NULL. If the file was recently deleted and not yet committed to Git, then it will be TRUE.

  • status: A data frame with detailed information on the status of each R Markdown file (see below).

The data frame status contains the following non-mutually exclusive columns (all logical vectors):

  • ignored: The R Markdown file has been ignored by Git according to the patterns in the file .gitignore.

  • mod_unstaged: The R Markdown file has unstaged modifications.

  • conflicted: The R Markdown file has merge conflicts.

  • mod_staged: The R Markdown file has staged modifications.

  • tracked: The R Markdown file is tracked by Git.

  • committed: The R Markdown file has been previously committed to the Git repository.

  • published: The corresponding HTML file has been previously committed.

  • mod_committed: The R Markdown file has modifications that have been committed since the last time the HTML was built and committed.

  • modified: The R Markdown file has been modified since it was last published (i.e. mod_unstaged or mod_staged or mod_committed).

  • unpublished: The R Markdown file is tracked by Git but not published (i.e. the HTML has not been committed).

  • scratch: The R Markdown file is untracked by Git, i.e. it is considered a scratch file until it is committed.

Details

wflow_status reports analysis files with one of the following statuses:

  • Mod: Modified file. Any published file that has been modified since the last time the HTML was published.

  • Unp: Unpublished file. Any tracked file whose corresponding HTML is not tracked. May or may not have staged or unstaged changes.

  • Scr: Scratch file. Any untracked file that is not specifically ignored.

wflow_status only works for workflowr projects that use Git.

Examples

# NOT RUN {
wflow_status()
# Get status of specific file(s)
wflow_status("analysis/file.Rmd")
# Save the results
s <- wflow_status()
# }