interpolate_krige | R Documentation |
Interpolation and smoothing on the sphere by means of ordinary kriging.
interpolate_krige(
observations,
targets,
value,
lon_obs = lon,
lat_obs = lat,
lon_targets = lon,
lat_targets = lat
)
observations |
data.frame of observations. |
targets |
data.frame of locations to calculate the interpolated and smoothed values for (target points). |
value |
Column with values in |
lon_obs |
Column in |
lat_obs |
Column in |
lon_targets |
Column in |
lat_targets |
Column in |
observations
should include at least columns for longitude
and latitude.
targets
should include at least columns for longitude,
latitude and value of interest to interpolate and smooth.
Kriging can be considered as linear regression with spatially correlated residuals. Kriging is most appropriate when it is known there is a spatially correlated distance or directional bias in the data. It is often used in soil science and geology.
See splines on the
sphere
for interpolation and smoothing on the sphere by means of splines.
Object equal to object targets
including extra columns for
the predicted value and the variance.
Martin Haringa
gstat::krige
## Not run:
target <- sf::st_drop_geometry(nl_postcode3)
obs <- insurance %>% dplyr::sample_n(1000)
pop_df <- interpolate_krige(obs, target, population_pc4)
pop_sf <- left_join(nl_postcode3, pop_df)
choropleth(pop_sf, value = "population_pc4_pred", n = 13)
choropleth(pop_sf, value = "population_pc4_var", n = 13)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.