hashCheck: hashCheck

View source: R/hashCheck.r

hashCheckR Documentation

hashCheck

Description

Check for Changes in List of Objects

Usage

hashCheck(..., file, .print. = TRUE, .names. = NULL)

Arguments

...

a list of objects including data frames, vectors, functions, and all other types of R objects that represent dependencies of a certain calculation

file

name of file in which results are stored

.print.

set to FALSE to suppress printing information messages about what has changed

.names.

vector of names of original arguments if not calling hashCheck directly

Details

Given an RDS file name and a list of objects, does the following:

  • makes a vector of hashes, one for each object. Function objects are run through deparse so that the environment of the function will not be considered.

  • see if the file exists; if not, return a list with result=NULL, hash = new vector of hashes, changed='All'

  • if the file exists, read the file and its hash attribute as prevhash

  • if prevhash is not identical to hash: if .print.=TRUE (default), print to console a summary of what's changed return a list with result=NULL, hash = new hash vector, changed

  • if prevhash = hash, return a list with result=file object, hash=new hash, changed=”

Set options(debughash=TRUE) to trace results in ⁠/tmp/debughash.txt⁠

Value

a list with elements result (the computations), hash (the new hash), and changed which details what changed to make computations need to be run

Author(s)

Frank Harrell


Hmisc documentation built on Sept. 12, 2023, 5:06 p.m.