View source: R/ms_fill_missing_precip.R
ms_fill_missing_precip | R Documentation |
Fill precipitation gauges based on relationship to surrounding gauges.
ms_fill_missing_precip(
precip,
precip_gauge,
fill_method = "strongest_cor",
distance_threshold = NULL,
out_path = NULL,
verbose = TRUE
)
precip |
|
precip_gauge |
a sf object or path to a sf object of precipitation gauge locations |
fill_method |
One of strongest_cor, closest_gauge, or distance_weight. See details |
distance_threshold |
When distance_weight is selected, the distance in km other gauges will be used to fill each gauge of interest |
out_path |
Optional. path to save filled precipitation data |
verbose |
Optional logical. Should information be printed to console, default TRUE. |
ms_fill_missing_precip uses other gauges in a network to fill gaps in gauges when they are not reported data. Three different methods can be chosen.
strongest_cor uses the gauge with the strongest correlation to the gauge with missing data, and then uses a linear regression between the two gauges to fill in times of missing data. 2) closest_gauge uses a linear regression between the nearest gauge to the gauge with missing data. 3) distance_weight uses all gauges withing the selected distance_threshold and inverse distance weighting to fill the missing values.
returns a tibble
with filled precipitation data.
Spencer Rhea
Mike Vlah, vlahm13@gmail.com
Wes Slaughter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.