This is the data in my text file: (I have shown 10 rows out of 10,000) Index is the rownames, temp is time series and m are the values in mm.
"Index" "temp" "m"
1 "2012-02-07 18:15:13" "4297"
2 "2012-02-07 18:30:04" "4296"
3 "2012-02-07 18:45:10" "4297"
4 "2012-02-07 19:00:01" "4297"
5 "2012-02-07 19:15:07" "4298"
6 "2012-02-07 19:30:13" "4299"
7 "2012-02-07 19:45:04" "4299"
8 "2012-02-07 20:00:10" "4299"
9 "2012-02-07 20:15:01" "4300"
10 "2012-02-07 20:30:07" "4301"
Which I import in r using this:
x2=read.table("data.txt", header=TRUE)
I tried using the following code for aggregating the time series to daily data :
c=aggregate(ts(x2[, 2], freq = 96), 1, mean)
I have set the frequency to 96 because for 15 min data 24 hrs will be covered in 96 values.
it returns me this:
Time Series:
Start = 1
End = 5
Frequency = 1
[1] 5366.698 5325.115 5311.969 5288.542 5331.115
But i want the same format in which I have my original data i.e. I also want the time series next to the values. I need help in achieving that.