plotPresBar {PAMmisc} | R Documentation |
plotPresBar
Description
Creates a bar plot of the presence or density of detections across time
Usage
plotPresBar(
x,
start = NULL,
end = NULL,
bin = "hour/day",
by = NULL,
title = TRUE,
fill = "grey35",
format = c("%m/%d/%Y %H:%M:%S", "%m-%d-%Y %H:%M:%S",
"%Y/%m/%d %H:%M:%S", "%Y-%m-%d %H:%M:%S"),
plotTz = "UTC"
)
Arguments
x |
a data.frame of detections, must have a column |
start |
the beginning datetime of the plot, if |
end |
the ending datetime of the plot, if |
bin |
string identifying how to bin detections. Acceptable time units are
|
by |
(optional) if not |
title |
if |
fill |
the fill color for the bars, only used if |
format |
date format if |
plotTz |
the timezone to use for plotting the data. Note that inputs must still be in UTC, this option allows you to create plots scaled to local time. Valid values come from OlsonNames |
Value
a ggplot2 object
Author(s)
Taiki Sakai taiki.sakai@noaa.gov
Examples
df <- data.frame(UTC = as.POSIXct(runif(1e2, min=0, max=7*24*3600),
origin='1970-01-01 00:00:00', tz='UTC'),
label = sample(letters[1:3], 1e2, replace=TRUE))
# hours per day with detections
plotPresBar(df, bin='hour/day')
# calls per day - these options are identical
plotPresBar(df, bin='day')
plotPresBar(df, bin='call/day')
plotPresBar(df, bin='calls/day')
# calls per day, colored by 'label'
plotPresBar(df, bin='day', by='label')