proportional_shade {animbook} | R Documentation |
Proportional shaded data
Description
This function creates a proportional shaded data using the specified parameters.
Usage
proportional_shade(
initial = NULL,
proportion = NULL,
y = NULL,
position = "left"
)
Arguments
initial |
A numerical of initial values for the proportional shade. |
proportion |
A vector of proportions corresponding to each group. |
y |
A numeric vector specifying the vertical position of the shade diagram. |
position |
A character string specifying the side of the shade diagram. This needs to be either "left" (default) or "right". |
Value
A data frame of the proportional shaded diagram.
Examples
data <- proportional_shade(4, c(0.4, 0.3, 0.2, 0.1), c(4, 3, 2, 1))
ggplot2::ggplot(data = data, ggplot2::aes(x = x, y = y, group = id, fill = as.factor(id))) +
ggplot2::geom_polygon(alpha = 0.1)
[Package animbook version 1.0.0 Index]