summarize_sedc | R Documentation |
Calculate Sum of Exponentially Decaying Contributions (SEDC) covariates
summarize_sedc(
point_from = NULL,
point_to = NULL,
id = NULL,
sedc_bandwidth = NULL,
threshold = NULL,
target_fields = NULL,
extent_from = NULL,
extent_to = NULL,
...
)
point_from |
|
point_to |
|
id |
character(1). Name of the unique id field in |
sedc_bandwidth |
numeric(1).
Distance at which the source concentration is reduced to
|
threshold |
numeric(1). For computational efficiency,
the nearest points in threshold will be selected.
|
target_fields |
character. Field names to calculate SEDC. |
extent_from |
numeric(4) or SpatExtent. Extent of clipping |
extent_to |
numeric(4) or SpatExtent. Extent of clipping |
... |
Placeholder. |
The SEDC is specialized in vector to vector summary of covariates
with exponential decay. Decaying slope will be defined by sedc_bandwidth
,
where the concentration of the source is reduced to $\exp(-3)$
(approximately 5 \
of the attenuating concentration with the distance from the sources.
It can be thought of as a fixed bandwidth kernel weighted sum of covariates,
which encapsulates three steps:
Calculate the distance between each source and target points.
Calculate the weight of each source point with the exponential decay.
Summarize the weighted covariates.
data.frame object with input field names with
a suffix "_sedc"
where the sums of EDC are stored.
Additional attributes are attached for the EDC information.
attr(result, "sedc_bandwidth")
: the bandwidth where
concentration reduces to approximately five percent
attr(result, "sedc_threshold")
: the threshold distance
at which emission source points are excluded beyond that
Distance calculation is done with terra
functions internally.
Thus, the function internally converts sf
objects in
point_*
arguments to terra
. Please note that any NA
values
in the input will be ignored in SEDC calculation.
Insang Song
Messier KP, Akita Y, Serre ML. (2012). Integrating Address Geocoding, Land Use Regression, and Spatiotemporal Geostatistical Estimation for Groundwater Tetrachloroethylene. Environmental Science & Technology 46(5), 2772-2780.(\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1021/es203152a")})
Wiesner C. (n.d.). Euclidean Sum of Exponentially Decaying Contributions Tutorial.
Other Macros for calculation:
extract_at()
,
kernelfunction()
,
summarize_aw()
library(terra)
library(sf)
set.seed(101)
ncpath <- system.file("gpkg/nc.gpkg", package = "sf")
nc <- terra::vect(ncpath)
nc <- terra::project(nc, "EPSG:5070")
pnt_from <- terra::centroids(nc, inside = TRUE)
pnt_from <- pnt_from[, "NAME"]
pnt_to <- terra::spatSample(nc, 100L)
pnt_to$pid <- seq(1, 100)
pnt_to <- pnt_to[, "pid"]
pnt_to$val1 <- rgamma(100L, 1, 0.05)
pnt_to$val2 <- rgamma(100L, 2, 1)
vals <- c("val1", "val2")
suppressWarnings(
summarize_sedc(pnt_from, pnt_to, "NAME", 1e5, 2e5, vals)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.