Learn R Programming

eq5dsuite (version 1.0.0)

.pchc_plot_by_dim: Wrapper to generate Paretian Classification of Health Change plot by dimension

Description

This internal function plots Paretian Classification of Health Change (PCHC) by dimension. The input is a data frame containing the information to plot, and the plot will contain bars representing the proportion of the total data that falls into each dimension, stacked by covariate. The wrapper is used in Figures 2.2-2.4.

Usage

.pchc_plot_by_dim(plot_data, ylab, title, cols, text_rotate = FALSE)

Value

A ggplot object containing the PCHC plot.

Arguments

plot_data

A data frame containing information to plot, with columns for name (the dimensions to plot), p (the proportion of the total data falling into each dimension), and fu (the follow-up).

ylab

The label for the y-axis.

title

The plot title.

cols

A vector of colors to use for the bars.

text_rotate

A logical indicating whether to rotate the text labels for the bars.

Examples

Run this code
plot_data <- data.frame(name = c("Dimension 1", "Dimension 2"),
p = c(0.5, 0.5),
fu = c("Covariate A", "Covariate B"))
cols <- c("#99FF99", "#006600", "#FFCC99", "#663300")
.pchc_plot_by_dim(plot_data, "Proportion", "Example PCHC Plot", cols)

Run the code above in your browser using DataLab