diff options
author | Random Hacker <random_hacker@xapek.org> | 2010-08-31 16:33:23 +0200 |
---|---|---|
committer | Random Hacker <random_hacker@xapek.org> | 2010-08-31 16:33:23 +0200 |
commit | bcc3581e4aaef00f82da24e94fdd91c30314290b (patch) | |
tree | 26d0545b7c875c2d6c0e03538150ea028f5a1d7d /test.r | |
parent | 72fc24b265a40fad3f25baebf3bbe9e021b356c9 (diff) | |
download | ebus-alt-bcc3581e4aaef00f82da24e94fdd91c30314290b.tar.gz ebus-alt-bcc3581e4aaef00f82da24e94fdd91c30314290b.zip |
supsmu entfernt
Diffstat (limited to 'test.r')
-rwxr-xr-x | test.r | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -41,20 +41,19 @@ readNumericSensorDay <- function (sensorName) { " AND timestamp > now() - interval '1 day'", " ORDER BY timestamp desc", sep="")) d$timestamp <- as.POSIXct(round(d$timestamp, "mins")) - d <- supsmu(as.vector(d$timestamp), as.vector(d$value)) + #d <- supsmu(as.vector(d$timestamp), as.vector(d$value)) names(d) <- c("time", "value") -# myMean <- function(values) { -# print(mad(values)) -# if (mad(values) > 1) { -# print(paste("Streiche ",length(values), -# " Werte aus",sensorName, -# "mad =", mad(values))) -# values <- values * NA -# } -# mean(values) -# } -# + myMean <- function(values) { + if (mad(values) > 2) { + print(paste("Streiche ",length(values), + " Werte aus",sensorName, + "mad =", mad(values))) + values <- values * NA + } + mean(values) + } + # dm <- aggregate(d$value, list(time=d$time), myMean) dm <- d dm$time <- as.POSIXct(dm$time,origin=nulltime) |