mortsplot {mort} | R Documentation |
Plot residence events
Description
Plot residence events, with the option of plotting identified mortalities. Plotting uses ggplot2. Interactive option also uses plotly.
Usage
mortsplot(
data,
type,
ID,
station,
res.start = "auto",
res.end = "auto",
morts = NULL,
singles = TRUE,
interactive = FALSE,
residences = NULL,
units = NULL,
season.start = NULL,
season.end = NULL,
facet = FALSE,
facet.axis = "x",
facet.by = "season",
verbose = TRUE
)
Arguments
data |
a dataframe of residence events. Residence events must include tag ID, location name, start time, and end time. |
type |
the method used to generate the residence events. Options are "mort", "actel", "glatos", "vtrack", or "manual". |
ID |
a string of the name of the column in |
station |
a string of the name of the column in |
res.start |
a string of the name of the column in |
res.end |
a string of the name of the column in |
morts |
a dataframe containing potential mortalities. The dataframe must
have the same ID, station, res.start, res.end, and residences column names
as |
singles |
option to adjust the end times of residence events so single detection events are visible. Adjustment is for visualization purposes only and should not obscure or impact the visualization of other residence events. |
interactive |
option to generate an interactive plot. |
residences |
an optional character string with the name of the column
in |
units |
units of the duration of the residence events in |
season.start |
the start date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
season.end |
the end date/time(s) of the period of interest. If the period of interest is the same in all study years, must be a character string in format "dd-mm". Otherwise, must be in POSIXt, or a character string in format YYYY-mm-dd HH:MM:SS. |
facet |
option to facet by year or season. If |
facet.axis |
option to position facets along x or y axis. Options are
"x" and "y". Default is "x". Note that |
facet.by |
option to facet by "season" (as defined with |
verbose |
option to display updates and progress bar as function is run. Default is TRUE. |
Value
a ggplot2 plot. Additional arguments (e.g., formatting axes,
legend, aes, manual colour scales) can be added as for any ggplot2 plot.
If interactive=TRUE
,
returns a plotly plot.
Examples
plot<-mortsplot(data=events,type="mort",ID="ID",station="Station.Name")
plot
# With mortalities plotted over residences:
morts<-morts(data=events,type="mort",ID="ID",station="Station.Name",
method="any",verbose=FALSE)
plot<-mortsplot(data=events,type="mort",ID="ID",station="Station.Name",
morts=morts)
plot