Learn R Programming

BayesMortalityPlus (version 0.2.3)

Heatmap.BLC: BLC: Heatmap for the life expectancy

Description

Draws a Heat Map based on the life expectancy of a fitted BLC or PredBLC model.

Usage

# S3 method for BLC
Heatmap(x, x_lab = NULL, age = NULL, color = c("red", "white", "blue"), ...)

Value

A ggplot2 heatmap of the life expectancy.

Arguments

x

A BLC or PredBLC object, result of a call to blc() function or forecast via predict() function.

x_lab

Description of the modelled object.

age

Vector with the ages to plot the heatmap.

color

Vector of colours used in the heatmap.

...

Further arguments passed to or from other methods.

See Also

Heatmap.HP() and Heatmap.DLM() for HP or DLM methods.

Examples

Run this code
## Importing log-mortality data from Portugal:
data(PT)
Y <- PT

## Fitting the model

fit = blc(Y = Y, M = 100, bn = 20)

## Heatmap:
Heatmap(fit, x_lab = 2000:2015, age = 18:80)

Run the code above in your browser using DataLab