barplot.encounterDuration: Draw a barplot representing the duration of encounters.

Description Usage Arguments Details Value Examples

View source: R/barplot.encounterDuration.r

Description

Given the result from a call to encounterDuration, this function draws a barplot. The plot contains one group of bars for each pair of IDs or bursts in the data (depending on the type of data). Each group contains a bar for each model for which the encounter duration was computed.

Usage

1
2
## S3 method for class 'encounterDuration'
barplot(height, col = NULL, units="auto", ...)

Arguments

height

The object containing the duration of encounters.

col

The colours to use in the plot. By default, takes colours with equally spaced hues in the hcl space.

units

The unit used on the y axis of the plot. Must be a unit accepted by difftime.

...

Other graphical parameters, e.g. from barplot.default.

Details

If height is an array, i.e. it was the result from a call to encounterDuration with groupBy=NULL, the name displayed under each pair of bars are the names of the IDs involved, separated by a hyphen. Otherwise, you may specify the labels yourself in the row names of height (which is a data.frame). If all labels are numeric, this function replaces them by the names of the bursts involved, separated by a hyphen.

Value

The return value is the same as what barplot.default returns, i.e. a vector or matrix indicating the coordinates of bar midpoints.

Examples

1
2
3
4
data("vervet_monkeys", package="moveBB")
	
ed <- encounterDuration(monkey.tr, 100, groupBy="GroupID")
barplot(ed)

moveBB documentation built on May 2, 2019, 5:50 p.m.