[R] Help about time series

Gabor Grothendieck ggrothendieck at myway.com
Tue Feb 1 05:05:40 CET 2005


Ferrari Nicolas <nicolas.ferrari <at> insee.fr> writes:

: 
: Hello,
: 
: When I create a ts object, I would like to get a particular value of this
: time serie according to the date and not the rank. 
: However, it seems necessary to use the rank as if it were a simple vector.


Try this:

oneval <- function(series, date) as.vector(window(series, date, date))

# test
ser <- ts(21:25, 101)
oneval(ser, 102)




More information about the R-help mailing list