plot.paths_animation {anipaths}R Documentation

Plot animation path interpolation

Description

This is mainly intended as a way to check that the interpolations used in the animation are working as expected.

Usage

## S3 method for class 'paths_animation'
plot(x, ..., i = 1, level = 0.05, type = "path", ylim_x = NULL, ylim_y = NULL)

Arguments

x

paths_animation object as created through a call to animate_paths().

...

additional arguments passed to plot.

i

index of individual to plot (corresponds to index in unique(paths[, 'ID.name')).

level

confidence level for error bands. NA removes bands.

type

either "path" (default) for two marginal interpolation plots, or "covariate" for a single interpolation plot

ylim_x

y-axis limits for marginal plots (x, easting, etc.)

ylim_y

y-axis limits for marginal plots (y, northing, etc.)

Examples

vultures$POSIX <- as.POSIXct(vultures$timestamp, tz = "UTC")
vultures_paths <- vultures[vultures$POSIX > as.POSIXct("2009-03-22", origin = "1970-01-01") &
  vultures$POSIX < as.POSIXct("2009-04-05", origin = "1970-01-01"), ]
interpolated_paths <-
  animate_paths(
    paths = vultures_paths,
    delta.t = 3600 * 6,
    coord = c("location.long", "location.lat"),
    Time.name = "POSIX",
    ID.name = "individual.local.identifier",
    max.knots = 13,
    return.paths = TRUE
  )
interpolated_paths_gp <-
  animate_paths(
    paths = vultures_paths,
    delta.t = 3600 * 6,
    coord = c("location.long", "location.lat"),
    Time.name = "POSIX",
    ID.name = "individual.local.identifier",
    max.knots = 3 * 13,
    return.paths = TRUE
  )
plot(interpolated_paths, i = 2)
plot(interpolated_paths_gp, i = 2, level = 0.01)

[Package anipaths version 0.10.1 Index]