Prepare the plotly figure for weather data
Arguments
- meteo_lst
nested list of lists with dataframes. Nested structure meteo_lst -> data -> Station ID -> Parameter -> Dataframe (DATE, PARAMETER).
- par
character marking weather variable to extract (i.e. "PCP", "SLR", etc).
- period
character describing, which time interval to display (default is "day", other examples are "week", "month", etc).
- fn_summarize
function to recalculate to time interval (default is "mean", other examples are "median", "sum", etc).
Examples
temp_path <- system.file("extdata", "weather_data.xlsx", package = "svatools")
met_lst <- load_template(temp_path, 4326)
#> [1] "Loading data from template."
#> [1] "Reading station ID9 data."
#> [1] "Reading station ID3 data."
#> [1] "Reading station ID10 data."
#> [1] "Reading station ID11 data."
#> [1] "Reading station ID12 data."
#> [1] "Reading station ID13 data."
#> [1] "Reading station ID1 data."
#> [1] "Reading station ID8 data."
#> [1] "Reading station ID2 data."
#> [1] "Reading station ID4 data."
#> [1] "Reading station ID5 data."
#> [1] "Reading station ID6 data."
#> [1] "Reading station ID7 data."
#> [1] "Reading station ID14 data."
#> [1] "Loading of data is finished."
plot_weather(met_lst, "PCP", "month", "sum")
#> Warning: n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors
#> Warning: n too large, allowed maximum for palette Set2 is 8
#> Returning the palette you asked for with that many colors