[R-SIG-Finance] Convert double to date

Peter Neumaier peter.neumaier at gmail.com
Thu Mar 10 09:20:35 CET 2016

Hi all, what appeared to be an easy task turns into a mystery - at least
from my previous experience with other languages.

I queried some historical data from an exchange and stored into a double

> typeof(a_fetchdata)
[1] "double"
> a_fetchdata[1,1:2]
                        NGFJ6.Open  NGFJ6.High
2016-02-09 07:30:00     0.2897      0.2897
#### Please note above result has no header for the date/time column

My goal is to take the date, deduct one day and arrive at "2016-02-08".

So I tried converting into a date (with paste/without paste)

But I keep running into the same error message:

*Error in dimnames(cd) <- list(as.character(index(x)), colnames(x)) :
'dimnames' applied to non-array*

Can anyone please shed some light on that?

Many thanks in advance,

	[[alternative HTML version deleted]]

More information about the R-SIG-Finance mailing list