extractdays: Extracts the rows of a matrix corresponding to the requested days (expressed as dates YYYY-MM-DD) given the date (origin) of the first row
Description
Extracts the rows of a matrix corresponding to the requested days (expressed as dates YYYY-MM-DD) given the date (origin) of the first row
Usage
extractdays(data = array(1:ndim_max, dim = c(ndim_max, 1)),
ndim_max = 1e+05, when = "1990-1-1", origin = "1961-1-1",
nday = 1)
Arguments
data
an input data matrix where each row corresponds to a daily record
ndim_max
maximum (integer) number of rows in data
where to find when
.
Default is 100000 and works if data
is missing.
when
desired dates for which the data are requested
origin
date corresponding to the first row of data
nday
(optional) number of days since when
to extract the data
Value
a matrix containing the requested rows