plotRatios {actel}R Documentation

Plot global/group residency

Description

By default, this function plots the global residency. However, you can use the argument 'group' to plot the results only from a specific animal group. Lastly, you can also use 'sections', rather than 'group', to compare the residency at a specific section (or group of sections) between the different groups.

Usage

plotRatios(
  input,
  group,
  sections,
  type = c("absolutes", "percentages"),
  title,
  xlab,
  ylab,
  col
)

Arguments

input

The results of an actel analysis (either explore, migration or residency).

group

An optional argument to plot only the data corresponding to one group.

sections

An optional argument to plot the residency of the multiple groups for a specific subset of sections.

type

The type of residency to be displayed. One of 'absolutes' (the default) or 'percentages'.

title

An optional title for the plot. If left empty, a default title will be added.

xlab, ylab

Optional axis names for the plot. If left empty, default axis names will be added.

col

An optional colour scheme for the detections. If left empty, default colours will be added.

Details

The output of plotRatios is a ggplot object, which means you can then use it in combination with other ggplot functions, or even together with other packages such as patchwork.

Value

A ggplot object.

Examples

# For this example, I have modified the example.results that come with actel,
# so they resemble a residency output

plotRatios(example.residency.results)

# Because plotRatios returns a ggplot object, you can store
# it and edit it manually, e.g.:
library(ggplot2)
p <- plotRatios(example.residency.results, group = "A")
p <- p + xlab("changed the x axis label a posteriori")
p

# You can also save the plot using ggsave!


[Package actel version 1.2.1 Index]