Learn R Programming

Hmisc (version 5.1-3)

hashCheck: hashCheck

Description

Check for Changes in List of Objects

Usage

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

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

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

Author

Frank Harrell

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