ds: Download Time Series from www.dataseries.org

Description Usage Arguments Details Examples

View source: R/ds.R

Description

ds downloads time series from www.dataseries.org. Data can be imported as a data.frame or an xts object.

Usage

1
2
3
4
5
ds(id, class = c("data.frame", "ts", "xts"))

cache_ls()

cache_rm()

Arguments

id

one ore more IDs, as given by www.dataseries.org.

class

class of the return value, either a "data.frame" (default) or an "xts" object (requires the xts package to be installed).

Details

Downloaded series are cached in memory as long as the R session is open. If you want to force an update, either restart the R session or run cache_rm to emtpy the cache. cache_ls is a utility function that lists all cached objects (see examples).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
ds(c("CCI.AIK", "CCI.ASSS"))               # data.frame
ds(c("CCI.AIK", "CCI.ASSS"), "ts")         # "ts" object
ds(c("CCI.AIK", "CCI.ASSS"), "xts")        # "xts" object

# list cached objects
cache_ls()

# empty in-memory cache, which forces a fresh download
cache_rm()

## End(Not run)

dataseries documentation built on May 1, 2019, 8:02 p.m.