Use this function to set up a workflow-directory structure.

proj_use_workflow(
  path_proj = "workflow",
  git_ignore_data = TRUE,
  open = rlang::is_interactive()
)

Arguments

path_proj

character path to workflow directory, relative to the project directory.

git_ignore_data

logical indicates to add data directory to .gitignore.

open

logical indicates to open the file for interactive editing.

Value

Invisible NULL, called for side effects.

Details

This function will create:

  • a directory according to the path_proj you provide; it will be added to .Rbuildignore. Within it:

    • a data directory, adding it to .gitignore if indicated.

    • a README.Rmd file.

In this context, a workflow is a sequence of RMarkdown files that are named, for example: 00-import.Rmd, 01-do-something.Rmd, etc., such that each RMarkdown file:

  • writes only to its own dedicated sub-directory of data.

  • reads only from data directories of "earlier" RMarkdown files.

You can have more than one workflow directory in a repository, but it will be easiest to manage if each workflow is its own "data universe", where data can be imported or exported only using specific files at the start and end of the workflow, for example: 00-import.Rmd and 99-publish.Rmd.

The easiest way to create additional RMarkdown files in your workflow is to call proj_workflow_use_rmd() while you have an existing RMarkdown file from that workflow open and active in the RStudio IDE.

You'll wish to customize README.Rmd, perhaps to make a roadmap of the other files you'll create, as well as a summary.

This workflow is designed to provides minimally (in a good way) functional markdown-based website that you can share via GitHub pages. You can make the site more functional, for example, using html_document.

The site can be rendered using proj_workflow_render().

Finally, you way wish to run the your workflow on a schedule, using GitHub Actions; you can use proj_workflow_use_action().

Examples

# not run because it creates side effects
if (FALSE) {
  proj_use_workflow()
}