[R] daily maximum temperature

Dominic Roye dominic.roye at gmail.com
Fri Nov 23 19:04:49 CET 2012


Hello,

I want to filter the daily maximum temperature. For this i made this
skript, but it come out wrong results. Can anybody help me?

Thanks for your help!

Best regards


datos$X <- as.POSIXct(strptime(datos$X, "%d/%m/%Y %H:%M:%S"))
z <- aggregate(zoo(datos$Ta), as.POSIXct(datos$X), max)


> str(datos)
'data.frame':   17137 obs. of  5 variables:
 $ X : Factor w/ 17136 levels "00/01/1900 0:00:00",..: 2 3 4 5 6 7 8 9 10 11 ...
 $ Ta: num  5.28 5.45 5.54 5.54 5.51 5.51 5.5 5.56 5.58 5.63 ...
 $ HR: int  100 100 100 100 100 100 100 100 100 100 ...
 $ RS: int  0 0 0 0 0 0 0 0 0 0 ...
 $ v : num  2.3 2.5 1.1 2.3 2.2 2.1 2.2 2.9 2.4 2.6 ...



str(z)
‘zoo’ series from 2010-01-01 00:10:00 to 2010-04-29 23:50:00
  Data: num [1:17129] 5.28 5.45 5.54 5.54 5.51 5.51 5.5 5.56 5.58 5.63 ...
  Index:  POSIXct[1:17129], format: "2010-01-01 00:10:00" "2010-01-01
00:20:00" "2010-01-01 00:30:00" "2010-01-01 00:40:00" ...
>



More information about the R-help mailing list