Root-to-root contact
mec_rootcontact.Rd
Simulates diffusive inoculum spread through root contact
Arguments
- treecover
a single-band
SpatRaster
where 1 represents host trees, and 0 represents background area- aoi
a
sf
polygon representing the area of interest. Used to mask the tree cover- poi
a single-point
sf
object denoting the point of interest to run the simulations- quiet
if
TRUE
, suppress any message or progress bar
Details
This function models inoculum movement due to root-to-root contact based on tree continuity. It calculates vegetation continuity by counting connected pixels within a 3×3 window. If continuity exists, a new raster is created with connected pixels marked as 1. The function then identifies all pixels connected to the foci within the study area. If no direct pixel-to-pixel contact between trees exists, the infection risk is considered zero.
References
Cardillo, E., Abad, E., Meyer, S., 2021. Iberian oak decline caused by Phytophthora cinnamomi: A spatiotemporal analysis incorporating the effect of host heterogeneities at landscape scale. For. Pathol. 51, e12667. doi:10.1111/efp.12667
Cardillo, E., Acedo, A., Abad, E., 2018. Topographic effects on dispersal patterns of Phytophthora cinnamomi at a stand scale in a Spanish heathland. PloS One 13, e0195060.
Examples
# \donttest{
## load packages
library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.4.0; sf_use_s2() is TRUE
library(terra)
#> terra 1.8.50
## load data
study_area_sf <- st_read(system.file("spatial/tejera.geojson", package = "phytorisk"))
#> Reading layer `tejera' from data source
#> `/home/runner/work/_temp/Library/phytorisk/spatial/tejera.geojson'
#> using driver `GeoJSON'
#> Simple feature collection with 1 feature and 1 field
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: 332469.4 ymin: 4206413 xmax: 333200.5 ymax: 4207244
#> Projected CRS: ETRS89 / UTM zone 30N
poi_sf <- st_read(system.file("spatial/poi.geojson", package = "phytorisk"))
#> Reading layer `poi' from data source
#> `/home/runner/work/_temp/Library/phytorisk/spatial/poi.geojson'
#> using driver `GeoJSON'
#> Simple feature collection with 1 feature and 0 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 332973.8 ymin: 4206649 xmax: 332973.8 ymax: 4206649
#> Projected CRS: ETRS89 / UTM zone 30N
trees_sr <- rast(system.file("spatial/trees_light.tiff", package = "phytorisk"))
## simulate mechanism
mec_rootcontact_sr <- mec_rootcontact(trees_sr, study_area_sf, poi_sf)
#> ℹ Preparing tree data...
#> ✔ Tree data prepared [53ms]
#>
#> ℹ Finding root-to-root contact...
#> ✔ Finished [12.8s]
#>
# }