Estimate a surface of first-date of invasion, given a sparse set of observation locations and times.

sr_fdoi(x, estimation_mask)

Arguments

x

A sr_obs object defined with sr_obs.

estimation_mask

A raster template for results.

Value

A RasterLayer with estimated dates of invasion at each pixel.

Details

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.

Examples

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))