summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandom Hacker <random_hacker@xapek.org>2010-08-31 16:33:23 +0200
committerRandom Hacker <random_hacker@xapek.org>2010-08-31 16:33:23 +0200
commitbcc3581e4aaef00f82da24e94fdd91c30314290b (patch)
tree26d0545b7c875c2d6c0e03538150ea028f5a1d7d
parent72fc24b265a40fad3f25baebf3bbe9e021b356c9 (diff)
downloadebus-alt-bcc3581e4aaef00f82da24e94fdd91c30314290b.tar.gz
ebus-alt-bcc3581e4aaef00f82da24e94fdd91c30314290b.zip
supsmu entfernt
-rwxr-xr-xtest.r23
1 files changed, 11 insertions, 12 deletions
diff --git a/test.r b/test.r
index 8a5885b..41a4b85 100755
--- a/test.r
+++ b/test.r
@@ -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)