plot_f: Plot the absolute risk (observed and population curve)

View source: R/years.R

plot_fR Documentation

Plot the absolute risk (observed and population curve)

Description

Plots the estimated observed and population curve for the following measures: years lost/saved (Andersen, 2017), or life years difference (Manevski, Ruzic Gorenjec, Andersen, Pohar Perme, 2022). Note that this function cannot be used for the years lost measure (Andersen, 2013).

Usage

plot_f(
  years,
  xlab = "Time interval",
  ylab = "Absolute risk",
  xbreak,
  ybreak,
  xlimits,
  ylimits,
  show.legend = TRUE
)

Arguments

years

the object obtained using function years.

xlab

a title for the x axis.

ylab

a title for the y axis.

xbreak

the breaks on the x axis (this is supplied to scale_x_continuous).

ybreak

the breaks on the y axis (this is supplied to scale_y_continuous).

xlimits

define the limits on the x axis (this is supplied to scale_x_continuous).

ylimits

define the limits on the y axis (this is supplied to scale_y_continuous).

show.legend

if TRUE, the legend is shown on the graph.

Details

A ggplot2 implementation for plotting the observed and population curves. The type of curves is dependent upon the measure calculated using years function (argument measure).

Value

A ggplot object

See Also

years, plot_years


relsurv documentation built on March 18, 2022, 5:15 p.m.

Related to plot_f in relsurv...