Re: [R] Merging on Datetime Column

2012-07-13 Thread Rui Barradas
Hello, Check the structure of what you have, df and newdf. You will see that in df dateTime is of class POSIXlt and in newDf newDateTime is of class POSIXct. Solution: [...] df$dateTime <- strptime(df$dateTime,"%m/%d/%Y %H:%M") df$dateTime <- as.POSIXct(df$dateTime) [...] Hope this helps,

[R] Merging on Datetime Column

2012-07-13 Thread vioravis
I have the following dataframe with the first column being of type datetime: dateTime <- c("10/01/2005 0:00", "10/01/2005 0:20", "10/01/2005 0:40", "10/01/2005 1:00", "10/01/2005 1:20") var1 <- c(1,2,3,4,5) var2 <- c(10,20,30,40,50) df <- dat