# load station information
data(camtraps)
# load record table
data(recordTableSample)
# create maps
Mapstest <- detectionMaps(CTtable = camtraps,
recordTable = recordTableSample,
Xcol = "utm_x",
Ycol = "utm_y",
stationCol = "Station",
speciesCol = "Species",
writePNG = FALSE,
plotR = TRUE,
printLabels = TRUE,
richnessPlot = TRUE,
addLegend = TRUE
)
# with a polygon in the background, and for one species only
# make a dummy polygon for the background
library(sf)
Sr1 = st_polygon(list(cbind(c(521500,526500,527000, 521500, 521500),
c(607500, 608000, 603500, 603500, 607500))))
aoi <- data.frame(name = "My AOI")
st_geometry(aoi) <- st_geometry(Sr1)
st_crs(aoi) <- 32650 # assign CRS: UTM50N
Mapstest2 <- detectionMaps(CTtable = camtraps,
recordTable = recordTableSample,
Xcol = "utm_x",
Ycol = "utm_y",
backgroundPolygon = aoi, # this was added
speciesToShow = c("PBE", "VTA"), # this was added
stationCol = "Station",
speciesCol = "Species",
writePNG = FALSE,
plotR = TRUE,
printLabels = TRUE,
richnessPlot = TRUE,
addLegend = TRUE
)
Run the code above in your browser using DataLab