second step

This commit is contained in:
2021-08-09 13:38:11 +02:00
parent 1f0cfb4437
commit d2f2382141

10
secondDbSteps.r Normal file
View File

@ -0,0 +1,10 @@
library(DBI)
library(tidyr)
con <- dbConnect(RPostgres::Postgres(), dbname='mainscnt', host='172.16.10.27', user='wn')
res <-dbSendQuery(con, "select time, location, freq from mainsfrequency where valid=1 and time >= '2021-08-05T00:00:00.0Z' and time < '2021-08-06T00:00:00.0Z'")
devices <- dbFetch(res)
dbClearResult(res)
dbDisconnect(con)
d2 <- devices %>% pivot_wider(names_from = location, values_from = freq)