Learn R Programming

workflowr (version 1.6.2)

wflow_update: Update a workflowr project

Description

Update an existing workflowr project to workflowr 1.0. If you have an existing project built with a beta version of workflowr (pre-1.0.0), you can use wflow_update to obtain the latest features. However, if you like your current project the way it is, you can continue to use workflowr as you have been by getting the latest bug fixes from workflowrBeta.

Usage

wflow_update(dry_run = TRUE, project = ".")

Arguments

dry_run

logical (default: TRUE). Preview the files to be updated.

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

A character vector of the updated files.

Details

By default, wflow_update is run in dry_run mode so that no unwanted changes are made. Here's how to update an existing project to workflowr 1.0:

# Preview the files that will be updated
wflow_update()
# Update the files
wflow_update(dry_run = FALSE)
# Preview the updates
wflow_build()
# Publish the updates
wflow_publish("_workflowr.yml", "Update to 1.0", all = TRUE)

Currently wflow_update checks for the following items:

  • Adds the site generator site: workflowr::wflow_site to index.Rmd

  • Replaces html_document with workflowr::wflow_html in _site.yml and the YAML header of the R Markdown files

  • Deletes analysis/chunks.R

  • Removes the imported chunks in the R Markdown files

  • Adds a _workflowr.yml file, but does not change any of the options (so that your site will continue to produce the same results)

  • Removes the workflowr line from include/footer.html (this is now inserted automatically by wflow_html)

Examples

Run this code
# NOT RUN {
# Preview the files to be updated
wflow_update()
# Update the files
wflow_update(dry_run = FALSE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab