getWU: Get Climate Data

Description Usage Arguments Value Examples

View source: R/get_timeseries.R

Description

Create weekly time series from meteorological station data in server taking the mean of the daily values.

Usage

1
2
3
4
5
6
7
getWU(
  stations,
  vars = "temp_min",
  finalday = Sys.Date(),
  iniSE = 201001,
  datasource = con
)

Arguments

stations

station code (4 digits).

vars

vector with meteorological variables. Available variables: "temp_min" (default), "temp_max","temp_med","data_dia","umid_min","umid_med","umid_max","pressao_min","pressao_med","pressao_max"

finalday

last day. Default is the last available. Format = Y-m-d.

datasource

Use "data/WUdata.rda" to use test dataset. Use the connection to the Postgresql server if using project data. See also DenguedbConnect to open the database connection.

Value

data.frame with the weekly data (cidade estacao data temp_min tmed tmax umin umed umax pressaomin pressaomed pressaomax)

Examples

1
2
3
4
NOT USE: con <- dbConnect(RSQLite::SQLite(), "../../AlertaDengueAnalise/mydengue.sqlite")
res = getWU(stations = c('SBRJ','SBGL'), vars="temp_min", iniSE = 201201)
res = getWU(stations = 'SBRJ', vars=c("temp_min", "temp_med"))
tail(res)

claudia-codeco/AlertTools documentation built on Aug. 12, 2021, 9:58 a.m.