Skip to content
Package to maintain a data cache.
Branch: master
Clone or download
Latest commit bc4a625 Feb 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
demo Various updates including a vignette. Jul 29, 2014
doc
man
vignettes
.Rbuildignore Fixes for CRAN check Nov 6, 2015
.gitignore
.travis.yml Fixes for CRAN check Nov 6, 2015
DESCRIPTION
DataCache.dev.R Fixed a build issue. Feb 21, 2019
NAMESPACE
NEWS
README.md

README.md

DataCache: R Package for Managing Data Caches

Build Status CRAN_Status_Badge

The latest development version can be installed using the devtools package:

devtools::install_github('jbryer/DataCache')

Example

This example will load weather data.

library('weatherData')
library('DataCache')

loadWeatherData <- function(station_id='ALB') {
	return(list(weather=getDetailedWeather(station_id, Sys.Date())))
}

cacheData(loadWeatherData)
cache.info()
cache.info(stale=c('2mins'=nMinutes(2)))

Wait two minutes so the cache becomes stale.

Sys.sleep(120)
cacheData(loadWeatherData, nMinutes(2))
You can’t perform that action at this time.