Learn R Programming

camtrapR (version 0.97.0)

activityOverlap: Plot overlapping kernel densities of two-species activities

Description

This function plots kernel density estimates of two species' diel activity data by calling the function overlapPlot from package overlap. It further computes the overlap coefficient Dhat1 by calling overlapEst.

Usage

activityOverlap(recordTable, 
  speciesA,
  speciesB,
  speciesCol = "Species",
  recordDateTimeCol = "DateTimeOriginal",
  recordDateTimeFormat = "%Y-%m-%d %H:%M:%S",
  plotR = TRUE, 
  writePNG = FALSE, 
  addLegend = TRUE,
  legendPosition = "topleft",
  plotDirectory, 
  createDir = FALSE, 
  pngMaxPix = 1000,
  add.rug = TRUE,
  ...
)

Arguments

recordTable
data.frame. the record table created by recordDatabase
speciesA
Name of species 1
speciesB
Name of species 2
speciesCol
character. name of the column specifying species in recordTable
recordDateTimeCol
character. name of the column specifying date and time in recordTable
recordDateTimeFormat
format of column recordDateTimeCol in recordTable
plotR
logical. Create plots in R graphics device?
writePNG
logical. Create pngs of the plots?
addLegend
logical. Add a legend to the plots?
legendPosition
character. Position of the legend (keyword)
plotDirectory
character. Path of the pngs
createDir
logical. Create plotDirectory?
pngMaxPix
integer. number of pixels in pngs along x axis
add.rug
logical. add a rug to the plot?
...
additional arguments to be passed to function overlapPlot

Value

  • Returns invisibly the data.frame with plot coordinates from overlapPlot.

Details

... can be graphical parameters, e.g. linetype, linewidth, linecol.

References

Mike Meredith and Martin Ridout (2014). overlap: Estimates of coefficient of overlapping for animal activity patterns. R package version 0.2.4. http://CRAN.R-project.org/package=overlap Ridout, M.S. and Linkie, M. (2009) Estimating overlap of daily activity patterns from camera trap data. Journal of Agricultural, Biological and Environmental Statistics, 14, 322-337.

See Also

activityDensity http://www.kent.ac.uk/smsas/personal/msr/overlap.html

Examples

Run this code
# load record database
data(recordDatabaseSample)

# define species of interest
speciesA_for_activity <- "VTA"    # = Viverra tangalunga, Malay Civet
speciesB_for_activity <- "PBE"    # = Prionailurus bengalensis, Leopard Cat

# create activity overlap plot
activityOverlap (recordDatabaseSample,
  speciesA = speciesA_for_activity,
  speciesB = speciesB_for_activity,
  writePNG = FALSE,
  plotR = TRUE,
  createDir = FALSE,
  pngMaxPix = 1000,
  linecol = c("red", "blue"),
  linewidth = c(3,3),
  add.rug = TRUE
)

Run the code above in your browser using DataLab