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.
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
)
The name of the report factory to be created.
The folder where the report factory should be created. This will default to the current directory.
The name of the folder to be used for report templates; defaults to 'report_sources/'.
The name of the folder to be used for saving the built reports; defaults to 'outputs/'.
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.
A logical
indicating if a 'README' file should be
created; defaults to TRUE.
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.
a logical
indicating if new_factory()
should
create folders to store data; defaults to TRUE.
a logical
indicating if new_factory()
should
create folders to store R scripts; defaults to TRUE.
a logical
indicating if new_factory()
should create
a .here
file that can be used with here::here()
; defaults to TRUE.
a logical
indicating if new_factory()
should create
a .Rproj
file that can be used with RStudio; defaults to TRUE.
a logical
indicating if new_factory()
should create
a minimal '.gitignore' file; defaults to TRUE.
the report factory folder location (invisibly)
Assuming the default names are used then new_factory
will create a report
factory folder (called "new_factory") that includes:
report_sources
: a folder for storing the .Rmd reports
outputs
: a folder storing the compiled reports
factory_config
: a control file used to anchor a report factory
Depending on the values of the logical arguments, the factory may also include:
README.md
: Example README with instructions on how to use report factory.
.gitignore
: a file used to tell git to ignore certain files including the
produced outputs in outputs()
.
data/raw/
: a folder for storing raw data
data/raw/example_data.csv
: a set of data for use with the example report
data/clean/
: a folder for storing cleaned data
scripts/
: a folder to store additional code that may be called in reports
report_sources/example_report.Rmd
: an example .Rmd report template
.here
: a file to anchor calls to here::here()