Skip to contents

Produce rainbow plot (coloured by time index) of demographic variable against age. If object has no age variable, the variable is plotted against time instead, with a line for each combination of keys.

Usage

# S3 method for class 'vital'
autoplot(object, .vars = NULL, age = NULL, ...)

Arguments

object

A vital including an age variable and the variable you wish to plot.

.vars

The name of the variable you wish to plot.

age

The name of the age variable. If not supplied, the function will attempt to find it.

...

Not used.

Value

A ggplot2 object.

References

Hyndman, Rob J & Shang, Han Lin (2010) Rainbow plots, bagplots, and boxplots for functional data. Journal of Computational and Graphical Statistics, 19(1), 29-45. https://robjhyndman.com/publications/rainbow-fda/

Author

Rob J Hyndman

Examples

autoplot(norway_fertility, Fertility)