Learn R Programming

move (version 4.2.5)

plotBursts: Plotting the centroids of a bursted track

Description

The plotBursts function plots bursted Move objects (see burst for how to create a bursted Move object). The function plots a circle at the midpoint of each burst segment (consecutive coordinates that belong to a single burst).

Usage

# S4 method for list
plotBursts(object, add=TRUE, 
            sizeFUN=function(x){as.numeric(diff(range(timestamps(x))),units ="mins")},
            col = NA, breaks = 3, ...)
            
  # S4 method for .MoveTrackSingleBurst
plotBursts(object, add=TRUE,
            sizeFUN=function(x){as.numeric(diff(range(timestamps(x))),units ="mins")}, 
            col = NA, breaks = 3, ...)

Arguments

object

a moveBurst object or a list of moveBurst objects

add

logical, if FALSE a new plot is generated, default is TRUE

sizeFUN

a function to calculate the size of the plotted circles (see 'Details')

breaks

how many size classes should the circles have, default is 3

col

a vector of color codes with the same length as the burstID. By default the standard colors from 1:8 are used (see palette() to obtain vector of default colors). If there are more than 8 burstIDs the colors are recycled

...

additional plot attributes

Author

Marco Smolla & Anne Scharf

Details

sizeFUN
The color of the circles correspond to the burstIDs. The size of the cycles can have different meanings, depending on what function is defined. By default the size refers to the relative time of the burst segment compared to the whole track. This argument accepts any personalized function.

Examples

Run this code
data(leroy)
behav <- c(rep(1:4,each=200), rep(5, 118))
testb <- burst(leroy, f=behav)
plot(coordinates(leroy),type="l")
plotBursts(testb, breaks=3, add=TRUE, pch=19)
plotBursts(testb, breaks=5, add=FALSE, pch=19, col=rainbow(5))

## plotting circle size of a moveBurst track by realtive segment length
plotBursts(object=testb, breaks=3, sizeFUN=function(x){sum(distance(x))}, pch=19, add=FALSE)

Run the code above in your browser using DataLab