Learn R Programming

momentuHMM (version 1.2.0)

plot.crwData: Plot crwData

Description

Plot observed locations, predicted locations, and error ellipses (if applicable) from crwData object.

Usage

# S3 method for crwData
plot(x, animals = NULL, compact = FALSE, ask = TRUE,
  plotEllipse = TRUE, ...)

Arguments

x

An object crwData (as returned by crawlWrap).

animals

Vector of indices or IDs of animals for which information will be plotted. Default: NULL ; all animals are plotted.

compact

TRUE for a compact plot (all individuals at once), FALSE otherwise (default -- one individual at a time).

ask

If TRUE, the execution pauses between each plot.

plotEllipse

If TRUE (the default) then error ellipses are plotted (if applicable)

...

Currently unused. For compatibility with generic method.

Details

In order for error ellipses to be plotted, the names for the semi-major axis, semi-minor axis, and orientation in x$crwPredict must respectively be error_semimajor_axis, error_semiminor_axis, and error_ellipse_orientation.

If the crwData object was created using data generated by simData or simObsData, then the true locations (mux,muy) are also plotted.

Examples

Run this code
# NOT RUN {
# extract simulated obsData from example data
obsData <- miExample$obsData

# extract crwMLE inputs from example data
inits <- miExample$inits # initial state
err.model <- miExample$err.model # error ellipse model

# create crwData object
crwOut <- crawlWrap(obsData=obsData,ncores=1,
         theta=c(4,0),fixPar=c(1,1,NA,NA),
         initial.state=inits,
         err.model=err.model)

plot(crwOut,compact=TRUE,ask=FALSE,plotEllipse=FALSE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab