cacheResource: Caching of a resource

View source: R/io.R

cacheResourceR Documentation

Caching of a resource

Description

Convenience function to flexibly save and restore an already processed expression data compendium via caching.

Usage

cacheResource(res, rname, ucdir = "GSEABenchmarkeR")

Arguments

res

Resource. An arbitrary R object.

rname

Character. Resource name.

ucdir

Character. User cache directory. Defaults to 'GSEABenchmarkeR', which will accordingly use tools::R_user_dir("GSEABenchmarkeR", which = "cache").

Value

None. Stores the object in the cache by side effect.

Author(s)

Ludwig Geistlinger <Ludwig.Geistlinger@sph.cuny.edu>

See Also

loadEData, R_user_dir, BiocFileCache

Examples


     # load user-defined expression compendium
     data.dir <- system.file("extdata/myEData", package = "GSEABenchmarkeR")
     edat <- loadEData(data.dir)

     # do some processing of the compendium
     edat <- lapply(edat, function(d) d[1:50,])

     # cache it ...
     cacheResource(edat, "myEData")

     # ... and restore it at a later time
     edat <- loadEData(data.dir, cache = TRUE)    


waldronlab/GSEABenchmarkeR documentation built on Nov. 3, 2023, 10:59 p.m.