Description Usage Arguments Value
View source: R/sampling_weight.R
Calculate weights for re-sampling with a spatial bias with phi look-up.
Observations have a distance that tends to 1 as
they are farther away from the closest relevant case (besides itself)
at time slice t
(meaning they are more likely to be kept).
Farthest away from relevant cases at time slice t: d -> 1.
1 2 3 4 5 6 7 8 9 10 11 |
df |
a data frame |
phi |
a vector of the relevance values of
|
rel.thr |
a relevance threshold above which an observation is considered relevant |
sites_sf |
An sf obejct containing station and IDs and
geometry points of the locations. As an alternative, provide
|
lon |
the name of the column containing the location's longitude |
lat |
the name of the column containing the location's latitude |
crs |
the code for the Coordinate Reference System |
site_id |
the name of the column containing location IDs |
time |
the column name of the time-stamp |
A vector of spatially-biased re-sampling weights, scaled to fit within range [0,1].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.