Loads data from file cache, which is unique for an optional key object.

# Default S3 method
readCacheHeader(file, ...)

Arguments

file

A filename or a connection.

...

Not used.

Value

Returns a named list structure with element identifier, version, comment (optional), sources (optional), and timestamp.

Author

Henrik Bengtsson

See also

Examples


data <- 1:120
key <- list(some=1, vari=2, ables=3)

saveCache(key=key, data, comment="A simple example of a cached object.")

header <- readCacheHeader(findCache(key=key))
print(header)
#> $identifier
#> [1] "Rcache v0.1.7 (R package R.cache by Henrik Bengtsson)           "
#> 
#> $version
#> [1] "0.1.7"
#> 
#> $comment
#> [1] "A simple example of a cached object."
#> 
#> $timestamp
#> [1] "2025-05-14 18:43:44 UTC"
#> 

# Clean up
file.remove(findCache(key=key))
#> [1] TRUE