sr_fdoi.Rd
Estimate a surface of first-date of invasion, given a sparse set of observation locations and times.
sr_fdoi(x, estimation_mask)
x | A |
---|---|
estimation_mask | A |
A RasterLayer with estimated dates of invasion at each pixel.
This function first takes the earliest observed case in a neighbourhood,
as defined by the parameter neigh_tol
in the definition of
x
. Next, it interpolates the earliest observations with a
smooth surface, using a Thin-Plate splines model.
d <- data.frame(lon = runif(30), lat = runif(30)) d <- transform(d, date = round(10 * sqrt(lon**2 + lat**2))) sro <- sr_obs(d, "date") r <- raster(st_sf(sro), vals = 1) fdoi <- sr_fdoi(sro, r) plot(fdoi, col = hcl.colors(12))points(d)