Révision 5e1de699 src/R/cachecache.R
b/src/R/cachecache.R | ||
---|---|---|
1 | 1 |
get_content = structure( function(## Get content from cached |
2 | 2 |
### Access to the cached content of a file via the global variable CACHE_CACHE. Load content in CACHE_CACHE if needed. |
3 |
filename, ##<< The path to the file that contain dataset. |
|
4 |
class=NULL, ##<< The class of dataset. |
|
3 |
filename, ##<< The path to the file that contain dataset |
|
4 |
class=NULL, ##<< The class of dataset |
|
5 |
FORCE_RELOAD=FALSE, ##<< Force cachecache to reload the value |
|
5 | 6 |
... ##<< Parameters that will be passed to my_read |
6 | 7 |
) { |
7 | 8 |
if (inherits(try(CACHE_CACHE,TRUE), "try-error") || is.null(CACHE_CACHE)) { |
... | ... | |
9 | 10 |
} |
10 | 11 |
obj = list(filename=filename) |
11 | 12 |
class(obj) = class |
12 |
if (is.null(CACHE_CACHE[[obj$filename]])) { |
|
13 |
if (is.null(CACHE_CACHE[[obj$filename]]) | FORCE_RELOAD) {
|
|
13 | 14 |
print(paste("Loading file ",obj$filename, sep="")) |
14 | 15 |
tmp_content = my_read(obj, ...) |
15 | 16 |
print("affect it...") |
Formats disponibles : Unified diff