plotTimes: Print circular graphics for time series.

View source: R/plot.R

plotTimesR Documentation

Print circular graphics for time series.

Description

Wraps functions adapted from the circular R package.

Usage

plotTimes(
  times,
  night = NULL,
  circular.scale = c("area", "linear"),
  col,
  alpha = 0.8,
  title = "",
  mean.dash = TRUE,
  mean.range = TRUE,
  mean.range.darken.factor = 1.4,
  rings = TRUE,
  file,
  width,
  height,
  bg = "transparent",
  ncol,
  legend.pos = c("auto", "corner", "bottom"),
  ylegend,
  xlegend,
  xjust = c("auto", "centre", "left", "right"),
  expand = 0.95,
  cex = 1
)

Arguments

times

A list of of time vectors (each vector will be plotted as a series).

night

A vector of two times defining the start and stop of the night period (in HH:MM format).

circular.scale

Allows the user to decide between using an area-adjusted scale ("area"), or a linear scale ("linear"). Defaults to "area", which better represents the proportion differences in the dataset.

col

A vector of colour names to paint each time series (colours will be added transparency).

alpha

A value between 0 and 1 for the opacity of each layer (defaults to 0.8).

title

A title for the plot.

mean.dash

Logical: Should the mean value be displayed on the plot's edge?

mean.range

Logical: Should the SEM be displayed? (only relevant if mean.dash = TRUE)

mean.range.darken.factor

A numeric factor to darken the mean range edges for each group. Values greater than 1 darken the colour, and values lower than 1 lighten the colour.

rings

Logical: Should inner plot rings be displayed?

file

A file name to save the plot to. Leave NULL to plot on active graphics device. Available file extensions: .svg, .pdf, .png and .tiff.

height, width

The height and width of the output file. Use inches for .pdf and .svg files or pixels for .png and .tiff files.

bg

The colour of the plot background. Defaults to "transparent".

ncol

The number of columns in which to set the legend items. By default, actel decides the number of columns based on the number of data series to be plotted.

legend.pos

Where should the legend be drawn? By default, actel decides whether to plot the legend in the corner of the plot at the bottom the plot depending on the number of data series to plot. Possible values: 'auto', 'corner', 'bottom'.

ylegend

Adjustment to the vertical positioning of the legend. Only relevant if the legend is being drawn in the corner of the plot.

xlegend

Adjustment to the horizontal positioning of the legend.

xjust

How the legend is to be justified when the legend is drawn at the bottom a the plot. One of 'auto' (i.e. let actel decide the best adjustment), 'left', 'centre', or 'right'.

expand

Parameter that controls the size of the plotted circle. Defaults to 0.95. Larger values expand the circle, while smaller values shrink the circle.

cex

A numerical vector giving the amount by which plotting characters and symbols should be scaled relative to the default. When saving the plot in a vectorial form, it is recommended to change the height and width arguments rather than the cex.

Details

For more details about the original functions, visit the circular package homepage at https://github.com/cran/circular

Value

A circular plot

Examples

# The output of timesToCircular can be used as an input to plotTimes.
x <- getTimes(example.results, location = "A1", n.events = "first", event.type = "arrival")
times <- timesToCircular(x)

# plot times
plotTimes(times)

# A night period can be added with 'night'
plotTimes(times, night = c("20:00", "06:00"))


actel documentation built on Oct. 19, 2023, 9:08 a.m.