new_factory: Create a new report factory

Description Usage Arguments Details Value Examples

View source: R/new_factory.R

Description

This function can be used to create a new report factory. By default, the factory is created with a template of report, and the working environment is moved to the newly created factory.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
new_factory(
  factory = "new_factory",
  path = ".",
  report_sources = "report_sources",
  outputs = "outputs",
  move_in = TRUE,
  create_README = TRUE,
  create_example_report = TRUE,
  create_data_folders = TRUE,
  create_scripts_folder = TRUE,
  use_here = TRUE,
  use_rproj = TRUE,
  create_gitignore = TRUE
)

Arguments

factory

The name of the report factory to be created.

path

The folder where the report factory should be created. This will default to the current directory.

report_sources

The name of the folder to be used for report templates; defaults to 'report_sources/'.

outputs

The name of the folder to be used for saving the built reports; defaults to 'outputs/'.

move_in

A logical indicating if the current session should move into the created factory; defaults to TRUE. If use_rproj is also TRUE and RStudio is being used then the corresponding project will be opened.

create_README

A logical indicating if a 'README' file should be created; defaults to TRUE.

create_example_report

A logical indicating if new_factory() should create an example report in the 'report_sources' folder along with some example data in the 'data/raw' folder; defaults to TRUE.

create_data_folders

a logical indicating if new_factory() should create folders to store data; defaults to TRUE.

create_scripts_folder

a logical indicating if new_factory() should create folders to store R scripts; defaults to TRUE.

use_here

a logical indicating if new_factory() should create a .here file that can be used with here::here(); defaults to TRUE.

use_rproj

a logical indicating if new_factory() should create a .Rproj file that can be used with RStudio; defaults to TRUE.

create_gitignore

a logical indicating if new_factory() should create a minimal '.gitignore' file; defaults to TRUE.

Details

Assuming the default names are used then new_factory will create a report factory folder (called "new_factory") that includes:

Depending on the values of the logical arguments, the factory may also include:

Value

the report factory folder location (invisibly)

Examples

1
2
f1 <- new_factory("new_factory_1", move_in = FALSE)
f2 <- new_factory("new_factory_2", move_in = TRUE)

reportfactory documentation built on Aug. 9, 2021, 5:07 p.m.