diff options
author | Random Hacker <random_hacker@xapek.org> | 2010-08-27 19:46:02 +0200 |
---|---|---|
committer | Random Hacker <random_hacker@xapek.org> | 2010-08-27 19:46:02 +0200 |
commit | 05859a90d82238880101d9414f7e43f2201cd290 (patch) | |
tree | 4a9977eda3b8c068555cbe0cfde8644b9a8cc950 /test.r | |
parent | def9c7873cd3a42fbb7b0b4b21ae364e4c9d61c8 (diff) | |
parent | 39e11dd1f20aa30378715466608de8e8014389d9 (diff) | |
download | ebus-alt-05859a90d82238880101d9414f7e43f2201cd290.tar.gz ebus-alt-05859a90d82238880101d9414f7e43f2201cd290.zip |
Merge branch 'master' of /var/repos/ebus
Diffstat (limited to 'test.r')
-rwxr-xr-x | test.r | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#!/usr/bin/Rscript --vanilla +require(RPostgreSQL) + +drv <- dbDriver("PostgreSQL") +con <- dbConnect(drv, host="10.2.2.22", user="jack", password="jack", dbname="ebus") + + +# plot 1 +png(file = "Rplots.png") +data <- dbGetQuery(con, "select DISTINCT timestamp,value_float from value where sensor_id = 47") +print(data) +data$timestamp <- as.POSIXlt(as.character(data$timestamp)) + +plot(data$timestamp, data$value_float,type="l",axes=FALSE) + +r <- as.POSIXct(range(data$timestamp)) +axis.POSIXct(1, at=seq(r[1], r[2], by="hour"), format="%H") + +title("Temperaturplot") +box() +print(data) + +dev.off() + +#dbDisconnect(con) |