save_chunk: Run chunk and save to file, load file if it exists

Description Usage Arguments Author(s)

View source: R/save_chunk.R

Description

For an Rmarkdown chunk, check if a file exists containing the results, and if it doesn't, run an expression, and save the resulting objects. Useful when writing Rmarkdown reports with time-intensive analyses; these can be run once and then saved.

Usage

1
save_chunk(expr)

Arguments

expr

An expression to be evaluated if the filename does not exist. Multiple expressions should be enclosed in curly braces. Objects created by this expression are stored in a file called filename.

Author(s)

Caspar J. van Lissa


cjvanlissa/motley documentation built on Sept. 23, 2019, 7:39 p.m.