Hi there,

I am trying to get the sum of rain per day.

That is what the data-set looks like:


Timestamp                        Rain_mm_Tot
2017-05-29 23:40:00         4.7999980
2017-05-29 23:50:00         1.2000000
2017-05-30 00:10:00         2.5800000
2017-05-30 00:20:00         1.2009600
2017-05-30 00:30:00         1.2000006
2017-05-30 00:40:00         2.5002480

First I tried to define the column as date format with:
data_date <-data[as.Date(data_date$Timestamp)<=as.Date("2017-06-15"),]


Then I tried to aggregate as followed:
data_date_sum <- aggregate(data_date$Timestamp, on = "days", k=1, 
by=list(cut(as.Date(data_date$Date))), FUN=sum)


R responds:
Error in as.Date.default(data_date$Date) :
   do not know how to convert 'data_date$Date' to class “Date”


I read serveral post, but no other fits to my format.
Because I am a beginner I am open for completely new ideas to sum the 
daily rain also.

Thanks a lot and all the best
Torben


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to