plotArray | R Documentation |
Plot simultaneous/cumulative presences at a give array or set of arrays
plotArray(
input,
arrays,
title,
xlab,
ylab,
lwd = 1,
col,
by.group = TRUE,
y.style = c("absolute", "relative"),
type = c("default", "bars", "lines"),
timestep = c("days", "hours", "mins"),
cumulative = FALSE,
ladder.type = c("arrival", "departure")
)
input |
The results of an actel analysis (either explore, migration or residency). |
arrays |
One or more arrays to be analysed. If multiple arrays are provided, data will be grouped. |
title |
An optional title for the plot. |
xlab, ylab |
Optional axis names for the plot. If left empty, default axis names will be added. |
lwd |
The line width, only relevant for line plots. |
col |
The colour of the lines or bars. |
by.group |
Logical: Should the data be presented separately for each group? |
y.style |
The style of the y axis. Either "absolute", for the number of animals that arrive in each day, or "relative", for the proportion of animals over the total number of animals that arrived. |
type |
The type of plot to be drawn. By default, a line is plotted if cumulative = TRUE, and bars are plotted otherwise. |
timestep |
The time resolution for the grouping of the results. Defaults to "days", but can be set to "hours" and "mins" (at the expense of computing time). |
cumulative |
Logical. If TRUE, a cumulative plot of arrivals is drawn, otherwise the number of tags simultaneously present at the array(s) is drawn. |
ladder.type |
Type of cumulative plot to show. "arrival" to plot the moments of arrival, or "departure" to plot the moments of departure. Not applicable for non-cumulative plots. |
A ggplot object.
# Using the example results that come with actel
plotArray(example.results, arrays = "A9")
# Because plotArray returns a ggplot object, you can store
# it and edit it manually, e.g.:
library(ggplot2)
p <- plotArray(example.results, arrays = "A9")
p <- p + xlab("changed the x axis label a posteriori")
p
# You can also save the plot using ggsave!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.