# NOT RUN {
## Make a mask from a group of input layers:
list2env(ConwyData, environment())
network <- LandUseChange
spatialData <- c(ConwyLU, ConwySlope, ConwyStatus)
m <- aoi(spatialData)
m
## Plot mask
library(raster)
m <- aoi(ConwyLU)
plot(m)
## Make mask from a subset of values and plot
m <- aoi(ConwyLU, mskSub=c(2,3))
plot(m)
## Return coordinates of valid mask locations
coord <- aoi(ConwyLU, xy=TRUE)
head(coord)
## Using a bounding box
aoi(ConwyLU, bbox=c(270000, 284950, 347000, 365000))
## For vectorial spatial data. Note xy=TRUE shall return the features IDs
Conwy = sf::st_read(system.file("extdata", "Conwy.shp", package = "bnspatial"))
aoi(Conwy, bbox=c(270000, 284950, 347000, 365000))
# }
Run the code above in your browser using DataLab