Hi Jon,
zoo is great for tasks like this, not just for na.approx. :)
I would approach the problem like this:
library(zoo)
# put lightdata into a zoo object
z <- with(lightdata, zoo(light,
as.POSIXct(paste(date, time), format="%m/%d/%y %H:%M:%S")))
# merge the above zoo object with an "empty" z
Hi
Why you do not change date and time to POSIX object? It is simple and saves you
a lot of frustration when merging two data frames.
If you changed lightdata date and time to new column
lightdata$newdate <- strptime(paste(lightdata$date, lightdata$time, sep=" "),
format = "%d/%m/%y %H:%M:%S")
2 matches
Mail list logo