summaryrefslogtreecommitdiff
path: root/test.r
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2010-08-29 23:22:03 +0200
committeryvesf <yvesf-git@xapek.org>2010-08-29 23:22:03 +0200
commit4c33902c84b49218f17d9d9840da37d4fecf7c24 (patch)
treeda890136f35f31a3d9a52a34fdb6741349bd158f /test.r
parent1e369ca9a29dec3f46d4cd50a7149c883be3f464 (diff)
downloadebus-alt-4c33902c84b49218f17d9d9840da37d4fecf7c24.tar.gz
ebus-alt-4c33902c84b49218f17d9d9840da37d4fecf7c24.zip
utc<->gmt conversion
Diffstat (limited to 'test.r')
-rwxr-xr-xtest.r8
1 files changed, 4 insertions, 4 deletions
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))