Skip to contents

Produce rainbow plot (coloured by time index) of demographic variable against against age.

Usage

rainbow_plot(.data, .vars = NULL, age)

Arguments

.data

A vital, tsibble or fable object including an age variable and the variable you wish to plot.

.vars

A bare expression containing the name of the variable you wish to plot.

age

Variable in `.data` containing start year of age intervals. If omitted, and `.data` is not a vital object, the variable with name `Age` or `Age_group` will be used (not case sensitive).

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.

Author

Rob Hyndman

Examples

rainbow_plot(aus_fertility, Fertility)