Provide a dataset with the necessary meta-data for spread-rate estimation.

sr_obs(x, timevar, uq)

Arguments

x

data frame with geographical coordinates or sf object of type POINT, or another sr_obs object.

timevar

Character. Variable name with observation times or dates.

uq

Object created with sr_uq() with parameters of Uncertainty Quantification.

Value

Object of class sr_obs, which is a sf of type POINT with complementary meta-data.

Details

If your dataset is projected (no lon/lat variables) then first build the sf object yourself using the corresponding Coordinate Reference System. See example.

This function will produce the Monte Carlo samples from the dataset and the uq object, if necessary. It uses internally the function future_map which will take advantage of multiple processors or cluster access if you set a proper plan beforehand. See examples.

Examples

d_geo <- data.frame(lon = 1, lat = 1, date = 1) sr_obs(d_geo, "date")
#> Simple feature collection with 1 feature and 1 field #> geometry type: POINT #> dimension: XY #> bbox: xmin: 1 ymin: 1 xmax: 1 ymax: 1 #> epsg (SRID): 4326 #> proj4string: +proj=longlat +datum=WGS84 +no_defs #> date geometry #> 1 1 POINT (1 1)
## Projected coordinates d_prj <- data.frame(x = 1, y = 1, date = 1) d.sf <- st_as_sf(d_prj, coords = c("x", "y"), crs = 27561) sr_obs(d.sf, "date")
#> Simple feature collection with 1 feature and 1 field #> geometry type: POINT #> dimension: XY #> bbox: xmin: 1 ymin: 1 xmax: 1 ymax: 1 #> epsg (SRID): 27561 #> proj4string: +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs #> date geometry #> 1 1 POINT (1 1)
# NOT RUN { ## Perform Monte Carlo samples in parallel library(furrr) plan(multiprocess) uq <- sr_uq(nsim = 3, space = 1, time = 1) sr_obs(d_geo, "date", uq = uq) # }