Report an Issue / Request a Feature
I'm submitting a (Check one with "x") :
Issue Severity Classification -
(Check one with "x") :
Expected Behavior
When a file in data/ is changed but the resulting variable exists in the cache the file is not reloaded.
Current Behavior
Currently caching of the data is only done after the variable is loaded into memory, and cached variables are not reloaded if the original file was changed.
Version Information
Possible Solution
Update the cache function to also include a file argument, similar to the depends argument. If the digest of the file has changed reload the file and rebuild the cache. This could be done inside the reader as follows (using the 1.0 reader signature):
csv.reader <- function(file.name, variable.name, ...) {
cache(variable.name,
CODE = {
read.csv(file.name, ...)
},
file = file.name
)
}
This way assigning the variable in global namespace is left to cache, the CODE argument is evaluated as it is normally inside the cache function, and is only updated if the dependency in the file argument changed.
How do you guys feel about this?
Report an Issue / Request a Feature
I'm submitting a (Check one with "x") :
Issue Severity Classification -
(Check one with "x") :
Expected Behavior
When a file in
data/is changed but the resulting variable exists in the cache the file is not reloaded.Current Behavior
Currently caching of the data is only done after the variable is loaded into memory, and cached variables are not reloaded if the original file was changed.
Version Information
Possible Solution
Update the
cachefunction to also include afileargument, similar to thedependsargument. If the digest of the file has changed reload the file and rebuild the cache. This could be done inside the reader as follows (using the 1.0 reader signature):This way assigning the variable in global namespace is left to
cache, theCODEargument is evaluated as it is normally inside thecachefunction, and is only updated if the dependency in thefileargument changed.How do you guys feel about this?