Learn R Programming

foieGras (version 0.6-9)

plot.fG_mpm: plot

Description

visualize fits from an fG_mpm object

Usage

# S3 method for fG_mpm
plot(x, y = NULL, pages = 1, asp = 0, ncol = 1, ...)

Arguments

x

a foieGras mpm fit object with class fG_mpm

y

optional ssm fit object with class fG_ssm corresponding to x. If absent, 1-d plots of gamma_t time series are rendered otherwise, 2-d track plots with locations coloured by gamma_t are rendered.

pages

plots of all individuals on a single page (pages = 1; default) or each individual on a separate page (pages = 0)

asp

used a fixed 1:1 aspect ratio for 2-d track plots (asp = 1), or allow aspect ratio to vary between plots (asp = 0; default). Ignored if y is NULL and/or pages = 0

ncol

number of columns to use for faceting. Default is ncol = 1 but this may be increased for multi-individual objects. Ignored if pages = 0

...

additional arguments to be ignored

Value

a ggplot object with either: 1-d time series of gamma_t estimates (if y not provided), with estimation uncertainty ribbons (95 or 2-d track plots (if y provided) coloured by gamma_t, with smaller points having greater uncertainty (size is proportional to SE^-2). Plots can be rendered all on a single page (pages = 1) or on separate pages.

Examples

Run this code
# NOT RUN {
# plot mpm fit object
# 1-d time-series plots
plot(xm) 
# 2-d track plots by adding ssm fit object
plot(xm, xs) 

# }

Run the code above in your browser using DataLab