View source: R/proportional-shade.R
| proportional_shade | R Documentation | 
This function creates a proportional shaded data using the specified parameters.
proportional_shade(
  initial = NULL,
  proportion = NULL,
  y = NULL,
  position = "left"
)
| 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". | 
A data frame of the proportional shaded diagram.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.