Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getChecksum

Generates a deterministic checksum for an R object


Description

Generates a deterministic checksum for an R object such that (i) if the same object is used again, then the same checksum is obtained, and (ii) if another object is used, then a different checksum is obtained with extremely high probability. In other words, it is highly unlikely that two different objects have the same checksum.

Usage

## Default S3 method:
getChecksum(object, ...)

Arguments

object

The object for which a checksum should be calculated.

...

Additional arguments passed to digest.

Details

Because getChecksum() is a generic function, it is possible to provide custom methods for specific classes of objects. This means that, if a certain class specifies fields that carry auxiliary data, then these can be excluded from the checksum calculation. For instance, assume that all objects of class 'TimestampedObject' contain timestamps specifying when each object was created. Then a custom getChecksum() method for this class can first drop the timestamp and then call the default getChecksum() function.

Value

Returns checksum represented as a character string.

Author(s)

Henrik Bengtsson

See Also

Internally, the digest method is used to calculate the checksum.


R.cache

Fast and Light-Weight Caching (Memoization) of Objects and Results to Speed Up Computations

v0.15.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.