Learn R Programming

BIRDS (version 0.2.0)

obsIndex: Observation Index

Description

This function extracts the proportion of visits (or observations) detecting a focal species to all visits (or observations) over time or space.

Usage

obsIndex(
  x,
  dimension,
  timeRes = NULL,
  focalSp = NULL,
  visits = TRUE,
  fs.rm = TRUE,
  norm = TRUE
)

Arguments

x

an object of class ‘SummarizeBirds’.

dimension

a character string indicating if the export should be "spatial" or "temporal"

timeRes

the time resolution as a character string if dimension = "temporal": "Yearly", "Monthly" or "Daily"

focalSp

the focal species to look for

visits

if TRUE (default) the observation index is calculated over number of visits, else uses the number of observations

fs.rm

if TRUE, assumes that the observations for the focal species are included in 'group' and will remove them

norm

if TRUE, the result is nomalized to a 0-1 range

Value

If dimension = "spatial" a ‘SpatialPolygonsDataFrame’ or a ‘xts’ timeseries if dimension = "temporal".

References

Telfer, Preston 6 Rothery (2002) <doi:10.1016/S0006-3207(02)00050-2>

Examples

Run this code
# 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