I have data in an hourly values.
SNo Date Hour X
1 2006-12-17 00:00:00 1.8824667
2 2006-12-17 01:00:00 3.3494000
3 2006-12-17 02:00:00 1.5872667
4 2006-12-17 03:00:00 1.6622000
5 2006-12-17 04:00:00 2.2157667
6 2006-12-17 05:00:00 1.9967333
7 2006-12-17 06:00:00 1.3033000
8 2006-12-17 07:00:00 1.6200333
9 2006-12-17 08:00:00 1.8905667
10 2006-12-17 09:00:00 2.5490667
11 2006-12-17 10:00:00 3.6289000
How would I create a time series out of this? What would be the frequency and start/end parameters?
The last date & time is
2010-11-26 21:00:00
xts
. – Histolysists
object, which has a constructor that hasstart
,end
, andfrequency
arguments. – Rootlessdata$dateTime = as.POSIXct(paste(data$Date,data$Hour), format = "%Y-%m-%d %H:%M:%S")
then you can create a time series object with something like this:data$ts = ts(ts = data$dateTime, start = data$dateTime[1], end = data$dateTime[nrow(data)])
– Malo