cachedRDSload {ramwas} | R Documentation |
Loads an .rds file rdsfilename
using readRDS
and returns the loaded object.
The object is also saved in a cache so that repeated calls of the
function with the same filename return the same object instanteneously.
cachedRDSload(rdsfilename)
rdsfilename |
Name of the RDS file. |
The cached object is stored in a private package environment.
Returns the object loaded with readRDS
from
rdsfilename
at this or a previous call of the function.
Andrey A Shabalin andrey.shabalin@gmail.com
### Change filename to hg19 CpGset filename = system.file("extdata", "qc_sample.rds", package = "ramwas") time1 = system.time( {obj1 = cachedRDSload(filename)} ) time2 = system.time( {obj1 = cachedRDSload(filename)} ) cat("First loading time:",time1[3],"seconds","\n") cat("Second loading time:",time2[3],"seconds","\n")