18 lines
575 B
R
18 lines
575 B
R
library(influxdbr)
|
|
|
|
con <- influx_connection(group="mainscnt")
|
|
q <- influx_query(con,
|
|
db="smarthome2",
|
|
query="select freq, host from mainsfrequency where time >= '2021-03-20T14:25:10.0Z' and time < '2021-03-20T14:26:10.0Z'",
|
|
return_xts=FALSE,
|
|
simplifyList = TRUE)
|
|
q <- q[c(-1, -2, -3, -1*ncol(q))]
|
|
q <- pivot_wider(q, names_from = "host", values_from = "freq")
|
|
q$mad <- apply(q[-1], 1, mad)
|
|
print.data.frame(q)
|
|
#f <- q$mad > 0.005
|
|
#f <- replace_na(f, FALSE)
|
|
#r <- q[f,c(TRUE)]
|
|
|
|
#print.data.frame(r)
|