ecd.data | R Documentation |
Read sample data by specifying the symbol. The two utilities, ecd.data
and ecd.data.arr
,
serves for slightly different purpose.
ecd.data
works off the xts object that has two rows:
the prices and log-returns indexed by the dates.
ecd.data.arr
and ecd.data.ts
separate the data into list of three vectors: x is the log-return, p is the prices, and d is the dates.
And allows for more sophisticated call for range of dates, and different ways of slice and lag.
ecd.data.arr
takes symbol as input, while ecd.data.ts
takes an xts object.
ecd.data(symbol = "dji") ecd.data.arr( symbol = "dji", start.date = "1950-01-01", end.date = "2015-12-31", on = "days", lag = 1, drop = 0, repeated = TRUE, cache = TRUE, do.kurtosis = FALSE ) ecd.data.ts( ts, start.date = "1950-01-01", end.date = "2015-12-31", on = "days", lag = 1, drop = 0, repeated = TRUE, do.kurtosis = FALSE )
symbol |
character, the symbol of the time series. Default: dji |
start.date, end.date |
Date or character of ISO format (YYYY-MM-DD), to specify the date range, default is from 1950-01-01 to 2015-12-31. Set start.date and end.date to NULL or "" if you wish to get the entire time series. |
on |
character, specify the calendar interval, days, weeks, months. Default is |
lag |
integer, specify the lags of return calculation, default is 1. |
drop |
integer, specify number of largest outliners to drop, default is 0. |
repeated |
logical, specify whether to use repeated sampling or unique sampling, default is |
cache |
logical, use R's options memory to cache xts data, default is |
do.kurtosis |
logical, if specified, calculate mean, sd, var, skewness, and kurtosis, default is |
ts |
xts, the time series |
ecd.data
returns an xts object for the time series, with two columns - "Close" and "logr".
ecd.data.arr
and ecd.data.ts
return a list of three vectors: x is the log-return, p is the prices, and d is the dates.
dji <- ecd.data() wti <- ecd.data("wti") spx <- ecd.data.arr("spx", lag=5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.