# NOT RUN {
grid <- makeGrid(gotaland, gridSize = 10)
PBD <- bombusObsShort
OB <- organizeBirds(PBD, sppCol = "scientificName", simplifySppName = TRUE)
SB <- summariseBirds(OB, grid=grid)
spp <- listSpecies(SB)
tempOI <- obsIndex(SB, "temporal", "yearly", focalSp=spp[3], fs.rm = FALSE)
plot(tempOI$relObs, main=spp[3])
spatOI <- obsIndex(SB, "spatial", focalSp=spp[3])
minOI <- min(spatOI$relObs, na.rm=TRUE)
maxOI <- max(spatOI$relObs, na.rm=TRUE)
palRW <- leaflet::colorNumeric(c("white", "red"), c(minOI, maxOI), na.color = "transparent")
plot(spatOI, col=palRW(spatOI$relObs), border="grey", main=spp[3])
legend("bottomleft", legend=seq(minOI, maxOI, length.out = 5),
col = palRW(seq(minOI, maxOI, length.out = 5)), pch = 15, bty="n")
# }
Run the code above in your browser using DataLab