View source: R/activityOverlap.R
activityOverlap | R Documentation |
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
.
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,
...
)
recordTable |
data.frame. the record table created by |
speciesA |
Name of species 1 (as found in |
speciesB |
Name of species 2 (as found in |
speciesCol |
character. name of the column specifying species names in |
recordDateTimeCol |
character. name of the column specifying date and time in |
recordDateTimeFormat |
character. format of column |
plotR |
logical. Show 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. Directory in which to create png plots if |
createDir |
logical. Create |
pngMaxPix |
integer. image size of png (pixels along x-axis) |
add.rug |
logical. add a rug to the plot? |
... |
additional arguments to be passed to function |
...
can be graphical parameters passed on to function overlapPlot
, e.g. linetype
, linewidth
, linecol
(see example below).
Returns invisibly the data.frame
with plot coordinates returned by overlapPlot
.
Please be aware that the function (like the other activity... function of this package) use clock time, not solar time. If your survey was long enough to see changes in sunrise and sunset times, this may result in biased representations of species activity.
Juergen Niedballa
Mike Meredith and Martin Ridout (2018). overlap: Estimates of coefficient of overlapping for animal activity patterns. R package version 0.3.2. https://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.
activityDensity
http://www.kent.ac.uk/smsas/personal/msr/overlap.html
# load record table
data(recordTableSample)
# define species of interest
speciesA_for_activity <- "VTA" # = Viverra tangalunga, Malay Civet
speciesB_for_activity <- "PBE" # = Prionailurus bengalensis, Leopard Cat
# create activity overlap plot (basic)
activityOverlap (recordTable = recordTableSample,
speciesA = speciesA_for_activity,
speciesB = speciesB_for_activity,
writePNG = FALSE,
plotR = TRUE
)
# create activity overlap plot (prettier and with some overlapPlot arguments set)
activityOverlap (recordTable = recordTableSample,
speciesA = speciesA_for_activity,
speciesB = speciesB_for_activity,
writePNG = FALSE,
plotR = TRUE,
createDir = FALSE,
pngMaxPix = 1000,
linecol = c("black", "blue"),
linewidth = c(5,3),
linetype = c(1, 2),
olapcol = "darkgrey",
add.rug = TRUE,
extend = "lightgrey",
ylim = c(0, 0.25),
main = paste("Activity overlap: ",
speciesA_for_activity, "-",
speciesB_for_activity)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.