diff options
author | yvesf <yvesf-git@xapek.org> | 2010-08-29 23:22:03 +0200 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2010-08-29 23:22:03 +0200 |
commit | 4c33902c84b49218f17d9d9840da37d4fecf7c24 (patch) | |
tree | da890136f35f31a3d9a52a34fdb6741349bd158f | |
parent | 1e369ca9a29dec3f46d4cd50a7149c883be3f464 (diff) | |
download | ebus-alt-4c33902c84b49218f17d9d9840da37d4fecf7c24.tar.gz ebus-alt-4c33902c84b49218f17d9d9840da37d4fecf7c24.zip |
utc<->gmt conversion
-rwxr-xr-x | test.r | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,17 +29,17 @@ for (i in seq(1,nrow(brenner))) { brennerBla <- rbind(brennerBla, data.frame(time=brenner$time[i], value_string=brenner$value_string[i])) } } -print(brennerBla) brenner <- brennerBla readNumericSensorDay <- function (sensorName) { d <- dbGetQuery(con, - paste("SELECT timestamp,COALESCE(value_int,value_float) \"value\"", + paste("SELECT timestamp", + " , COALESCE(value_int,value_float) \"value\"", " FROM value", " WHERE sensor_id IN (select id from sensor where name = '",sensorName,"')", " AND date_trunc('day',timestamp) = date_trunc('day',now()) ", " ORDER BY timestamp desc", sep="")) - d$timestamp <- as.POSIXct(round(d$timestamp, "mins"),tz="GMT") + d$timestamp <- as.POSIXct(round(d$timestamp, "mins")) dm <- aggregate(d$value, list(timestamp=d$timestamp), mean) names(dm) <- c("time", sensorName) dm @@ -80,7 +80,7 @@ box() for (i in c(1:nrow(brenner))) { print(brenner$time[i]) print(brenner$value_string[i]) - text(as.numeric(brenner$time[i])+7200, max(data[2:length(data)],na.rm=TRUE)/2, paste("ab hier", brenner$value_string[i]) ,srt=90) + text(as.numeric(brenner$time[i]), max(data[2:length(data)],na.rm=TRUE)/2, paste("ab hier", brenner$value_string[i]) ,srt=90) } r <- as.POSIXct(range(data$time)) |