View source: R/alert_functions.R
write_alerta | R Documentation |
Function to write the pipeline results into the database. Receives the object created by the function historico.alerta. If writetofile == TRUE, it saves the sql command in a text file. If FALSE, it will write directly in the database using the connection.
write_alerta(d, writetofile = FALSE, datasource = con, arq = "output.sql")
d |
object created by tabela_historico() |
writetofile |
TRUE if an sql object will be the output; FALSE if not. |
datasource |
posgreSQL conn to project's database |
arq |
file name to store sql object |
the same data.frame from the input
# Parameters for the model
cidades <- getCidades(regional = "Norte",uf = "Rio de Janeiro",datasource = con)
res <- pipe_infodengue(cities = cidades$municipio_geocodigo[1], cid10 = "A90",
datarelatorio = 202407, iniSE = 202301, nowcasting="none")
restab <- tabela_historico(res)
res2 <- pipe_infodengue(cities = cidades$municipio_geocodigo[1], cid10 = "A90",
datarelatorio = 202406, iniSE = 202301, nowcasting="none")
restab2 <- tabela_historico(res2)
# NOT RUN
t1 <- Sys.time()
write_alerta(restab[1:10,], writetofile = TRUE)
t2 <- Sys.time() - t1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.