wflow_start creates a minimal workflowr project. The default behaviour is to add these files to a new directory, but it is also possible to populate an already existing project. By default, it also changes the working directory to the workflowr project.

wflow_start(directory, name = NULL, git = TRUE, existing = FALSE,
  overwrite = FALSE, change_wd = TRUE)

Arguments

directory

character. The directory for the project, e.g. "~/new-project". When existing = FALSE, the directory will be created.

name

character (default: NULL). Project name, e.g. "My Project". When name = NULL, the project name is automatically set based on the argument directory. For example, if directory = "~/projects/myproject", then name is set to "myproject". name is displayed on the site's navigation bar and the README.md.

git

logical (default: TRUE). Should Git be used for version control? If directory is a new Git repository and git = TRUE, wflow_start will initialize the repository and make an initial commit. If git = TRUE and directory is already a Git repository, wflow_start will make an additional commit. In both cases, only files needed for the workflowr project will be included in the commit.

existing

logical (default: FALSE). Indicate if the specified directory already exists. The default prevents injecting the workflowr files into an unwanted location. Only set to TRUE if you wish to add the workflowr files to an existing project.

overwrite

logical (default: FALSE). Control whether to overwrite existing files. Only relevant if existing = TRUE. Passed to file.copy.

change_wd

logical (default: TRUE). Change the working directory to the directory.

Value

Invisibly returns absolute path to workflowr project.

Details

This is the initial function that organizes the infrastructure to create a research website for your project. Note that while you do not need to use RStudio with workflowr, do not delete the Rproj file because it is required by other functions.

See also

vignette("wflow-01-getting-started")

Examples

not_run({ wflow_start("path/to/new-project") # Provide a custom name for the project. wflow_start("path/to/new-project", name = "My Project") # Add workflowr files to an existing project. wflow_start("path/to/current-project", existing = TRUE) # Add workflowr files to an existing project, but do not automatically # commit them. wflow_start("path/to/current-project", git = FALSE, existing = TRUE) })