Skip to contents

Same as sensitivity_analysis() but it takes raster object and other parameters as an input.

  • sa_onrasters() is a wrapper around sean() function. Takes raster object and other parameters as an input.

  • msean_onrast() same as sa_onrasters(). Use this for side effects + results. Produces and plots the maps for the outcomes and results are returned as an object. It produces and plots the maps for the outcomes and results are returned as an object.

Usage

sa_onrasters(rast, link_thresholds = c(0), hd_thresholds = c(0), ...)

msean_onrast(
  global = TRUE,
  geoscale = NULL,
  res = reso(),
  outdir = tempdir(),
  ...
)

Arguments

rast

Raster object which will be used in analysis.

link_thresholds

Numeric vector. link threshold values

hd_thresholds

Numeric vector. host density threshold values

...

Additional parameters to be passed to sean().

global

Logical. TRUE if global analysis, FALSE otherwise. Default is TRUE

geoscale

Numeric vector. Geographical coordinates in the form of c(Xmin, Xmax, Ymin, Ymax) which EPSG:4326 in coordinate reference system. If geoscale is NuLL, the extent is extracted from rast(SpatRaster) using terra::ext().

res

Numeric. Resolution of the raster. Default is reso().

outdir

Character. Output directory for saving raster in TIFF format. Default is tempdir().

Value

A list of calculated CCRI indices after operations. An index is generated for each combination of paramters. One combination is equivalent to sean() function.

Details

Error not handled for non-overlapping extents.

References

Yanru Xing, John F Hernandez Nopsa, Kelsey F Andersen, Jorge L Andrade-Piedra, Fenton D Beed, Guy Blomme, Mónica Carvajal-Yepes, Danny L Coyne, Wilmer J Cuellar, Gregory A Forbes, Jan F Kreuze, Jürgen Kroschel, P Lava Kumar, James P Legg, Monica Parker, Elmar Schulte-Geldermann, Kalpana Sharma, Karen A Garrett, Global Cropland .connectivity: A Risk Factor for Invasion and Saturation by Emerging Pathogens and Pests, BioScience, Volume 70, Issue 9, September 2020, Pages 744–758, doi:10.1093/biosci/biaa067

Hijmans R (2023). terra: Spatial Data Analysis. R package version 1.7-46, https://CRAN.R-project.org/package=terra

See also

Use get_rasters() to obtain raster object.

msean_onrast() supported_sources()

Examples

# \donttest{
rr <- get_rasters(list(monfreda = c("avocado")))
res1 <- sa_onrasters(rr[[1]],
            global = FALSE,
            geoscale = c(-115, -75, 5, 32),
            c(0.0001, 0.00004),
            c(0.0001, 0.00005),
            c("sum", "mean"),
            res = 12)
res2 <- sa_onrasters(rr[[1]],
            global = TRUE,
            link_thresholds = c(0.000001),
            hd_thresholds = c(0.00015),
            agg_methods = c("sum"),
            res = 12)
res3 <- msean_onrast(rast = rr[[1]],
          link_thresholds = c(0.000001),
          hd_thresholds = c(0.00015))
# }