From 4c33902c84b49218f17d9d9840da37d4fecf7c24 Mon Sep 17 00:00:00 2001 From: yvesf Date: Sun, 29 Aug 2010 23:22:03 +0200 Subject: utc<->gmt conversion --- test.r | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test.r') diff --git a/test.r b/test.r index 117e7b6..8890373 100755 --- a/test.r +++ b/test.r @@ -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)) -- cgit v1.2.1