initial
This commit is contained in:
commit
6ff8d2a017
17
mainscnt-anomalia-detection.r
Normal file
17
mainscnt-anomalia-detection.r
Normal file
@ -0,0 +1,17 @@
|
||||
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)
|
Loading…
x
Reference in New Issue
Block a user