Learn R Programming

camtrapR (version 0.97.0)

detectionMaps: Generate maps of number of species and species presence by station

Description

Generates maps of species presence for all species that were recorded and the number of species by station. Output can be in R and/or in png.

Usage

detectionMaps(CTtable, 
  recordTable, 
  Xcol, 
  Ycol, 
  stationCol = "Station", 
  speciesCol = "Species", 
  richnessPlot = TRUE, 
  speciesPlots = TRUE,
  addLegend = TRUE,
  printLabels = FALSE, 
  smallPoints,
  plotR = TRUE, 
  writePNG = FALSE, 
  plotDirectory, 
  createDir = FALSE,       
  pngMaxPix = 1000
)

Arguments

CTtable
data.frame. contains station and camera coordinates
Xcol
character. name of the column specifying x coordinates in CTtable
Ycol
character. name of the column specifying y coordinates in CTtable
stationCol
character. name of the column specifying station ID in CTtable and recordTable
recordTable
data.frame. the record table created by recordDatabase
speciesCol
character. name of the column specifying species in recordTable
writePNG
logical. Create pngs of the plots?
plotR
logical. Create plots in R graphics device?
plotDirectory
character. Path of the pngs
createDir
logical. Create plotDirectory?
richnessPlot
logical. Generate a species richness plot?
speciesPlots
logical. Generate plots of all species number of independent events?
printLabels
logical. Add station labels to the plots?
smallPoints
numeric. Number by which to decrease point sizes in plots (optional).
addLegend
logical. Add legends to the plots?
pngMaxPix
integer. number of pixels in pngs on the longer side

Value

  • A data frame with station coordinates, numbers of events by species at each station and total species number by station. In addition and optionally, R graphics or png image files.

Examples

Run this code
# load station information
data(camtraps)

# load record database
data(recordDatabaseSample)


# create maps
Mapstest <- detectionMaps(CTtable = camtraps,
  recordTable = recordDatabaseSample,
  Xcol = "utm_x",
  Ycol = "utm_y",
  stationCol = "Station",
  speciesCol = "Species",
  writePNG = FALSE,
  plotR = TRUE,
  printLabels = TRUE,
  richnessPlot = TRUE,
  addLegend = TRUE
)

Run the code above in your browser using DataLab