Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbryer/datacache
Package to maintain a data cache.
https://github.com/jbryer/datacache
Last synced: about 2 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 (almost 6 years ago)
- Last Synced: 2024-08-13T07:15:06.047Z (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
README
#### DataCache: R Package for Managing Data Caches
[![Build Status](https://api.travis-ci.org/jbryer/DataCache.svg)](https://travis-ci.org/jbryer/DataCache?branch=master)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/DataCache)](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))
```