Check for Changes in List of Objects
hashCheck(..., file, .print. = TRUE, .names. = NULL)
a list
with elements result
(the computations), hash
(the new hash), and changed
which details what changed to make computations need to be run
a list of objects including data frames, vectors, functions, and all other types of R objects that represent dependencies of a certain calculation
name of file in which results are stored
set to FALSE
to suppress printing information messages about what has changed
vector of names of original arguments if not calling hashCheck
directly
Frank Harrell
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