https://github.com/jbryer/DataCache
Package to maintain a data cache.
https://github.com/jbryer/DataCache
Last synced: 4 months ago
JSON representation
Package to maintain a data cache.
- Host: GitHub
- URL: https://github.com/jbryer/DataCache
- Owner: jbryer
- Created: 2014-07-28T22:07:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-02-21T17:07:46.000Z (about 6 years ago)
- Last Synced: 2024-11-17T16:43:46.515Z (5 months ago)
- Language: R
- Size: 43.9 KB
- Stars: 7
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - jbryer/DataCache - Package to maintain a data cache. (R)
README
#### DataCache: R Package for Managing Data Caches
[](https://travis-ci.org/jbryer/DataCache?branch=master)
[](http://cran.r-project.org/package=DataCache)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))
```