Learn R Programming

camtrapR (version 0.97.0)

activityHistogram: Plot histogram of single-species activity

Description

The function generates a histogram of species diel activity in 1-hour intervals.

Usage

activityHistogram(recordTable, 
	species, 
	all.species = FALSE, 
	speciesCol = "Species", 
	recordDateTimeCol = "DateTimeOriginal", 
	recordDateTimeFormat = "%Y-%m-%d %H:%M:%S", 
	plotR = TRUE, 
	writePNG = FALSE, 
	plotDirectory, 
	createDir = FALSE, 
	pngMaxPix = 1000,
	...)

Arguments

recordTable
data.frame. the record table created by recordDatabase
species
Name of the single species for which to create a histogram of activity
all.species
logical. If TRUE, plots are created for all species. This overrides argument species
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?
plotDirectory
character. Path of the pngs
createDir
logical. Create plotDirectory?
pngMaxPix
integer. number of pixels in pngs along x axis
...
additional arguments to be passed to function hist

Value

  • It returns invisibly a vector of species record date and time in POSIXlt format. If allSpecies == TRUE, all species' vectors are returned in an invisible named list.

Details

Activity is calculated from the time of day of records. The date is ignored.

See Also

activityDensity, activityRadial, activityOverlap

Examples

Run this code
# load record database
data(recordDatabaseSample)

# generate activity histogram
species4activity <- "VTA"    # = Viverra tangalunga, Malay Civet

activityHistogram (recordTable = recordDatabaseSample,
                   species = species4activity,
                   all.species = FALSE)

Run the code above in your browser using DataLab