.pchc_plot_by_dim {eq5dsuite} | R Documentation |
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)
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. |
Value
A ggplot object containing the PCHC plot.
Examples
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)
[Package eq5dsuite version 1.0.0 Index]