# NOT RUN {
# 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(sp)
poly1 <- Polygon(cbind(c(521500,526500,527000, 521500),c(607500, 608000, 603500, 603500)))
poly2 <- Polygons(list(poly1), "s1")
poly3 <- SpatialPolygons(list(poly2))
Mapstest2 <- detectionMaps(CTtable = camtraps,
recordTable = recordTableSample,
Xcol = "utm_x",
Ycol = "utm_y",
backgroundPolygon = poly3, # 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