run_if_change: run_if_change

Description Usage Arguments Details

Description

Takes in R commands and the path to a location to store temporary files. The function will create the file if it doesn't already exist, store the objects there, and only re-run if there has been a change to a reference object.

Usage

1
2
3
4
5
6
7
run_if_change(
  code = NULL,
  object.names = NULL,
  compare = NULL,
  path = NULL,
  run = "auto"
)

Arguments

code

a code chunk wrapped in\ {}

object.names

a character vector. The names to be saved and loaded

compare

an object. The object which if changed, will cause the code to run.

path

a string. The path to the tempory file to be used. Must end in '.rData'

run

a bool. If True, the analyses will be re-run even if the comparitor is identical.

Details

Runs analyses and then caches them. Analyses are returned in a list.


JConigrave/papertools documentation built on Dec. 6, 2019, 8:51 a.m.