Hello
I have dataframes.
mydata1 -data.frame(value=c(15,20,25,30,45,50),dates=c(2005-05-25 07:00:00
,2005-05-25 19:00:00,2005-06-25 07:00:00,2005-06-25 19:00:00
,2005-07-25 07:00:00,2005-8-25 19:00:00))
or
mydata2 -data.frame(value=c(15,20,25,30,45,50),dates=c(2005-05-25 00:00:00
,2005-05-25
Hello,
The trick is to use seq() for date classes.
First of all, when creating data.frames use stringsAsFactors=FALSE, in
order not to convert them to factors. I've added this option to your
data.frame() instructions. And then,
mydata1$dates - as.POSIXct(mydata1$dates)
mydata1b$dates -
2 matches
Mail list logo