Filling missing variables from the closest stations, which has data.
Source:R/preparing.R
fill_with_closest.Rd
Filling missing variables from the closest stations, which has data.
Usage
fill_with_closest(
meteo_lst,
par_fill = c("TMP_MAX", "TMP_MIN", "PCP", "RELHUM", "WNDSPD", "SLR")
)
Arguments
- meteo_lst
meteo_lst nested list of lists with dataframes. Nested structure meteo_lst -> data -> Station ID -> Parameter -> Dataframe (DATE, PARAMETER). Nested meteo_lst -> stations Dataframe (ID, Name, Elevation, Source, geometry, Long, Lat).
- par_fill
vector of variables to be filled. Optional (default is c("TMP_MAX", "TMP_MIN","PCP", "RELHUM", "WNDSPD", "SLR")).
Examples
if (FALSE) {
temp_path <- system.file("extdata", "weather_data.xlsx", package = "svatools")
met_lst <- load_template(temp_path, 3035)
met_lst$data <- fill_with_closest(met_lst, c("TMP_MAX", "TMP_MIN"))
}