diff options
Diffstat (limited to 'test.r')
-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)) |