R/geom_area.R

Defines functions geom_area

Documented in geom_area

#' Draw an area plot
#'
#' `geom_area` is a geom that should be used in conjunction
#' with `ggplot` to draw an area plot.
#'
#' @usage
#'
#' ggplot(data, aes(x = var)) +
#'   geom_area()
#'
#' @export
#' @param data A tibble to be used for the area plot
#' @param var Specify which variable should be drawn on the x-axis.
#'
#' @examples
#' library(tidyverse)
#' library(gapminder)
#'
#' # Visualize the distribution of a variable (compare to
#' # geom_histogram)
#'
#' ggplot(gapminder, aes(x = lifeExp)) +
#'   geom_area(stat = "bin")
#'
#' # Visualize the distribution of a variable by group:
#'
#' ggplot(gapminder, aes(x = lifeExp, fill = continent)) +
#'   geom_area(stat = "bin")
#'
#' # Adjust the previous plot so that groups overlap ("dodge")
#' # instead of stack:
#'
#' ggplot(gapminder, aes(x = lifeExp, fill = continent)) +
#'   geom_area(stat = "bin", pos = "dodge")
#'
#' # Increase the transparency (alpha) of the area plot
#' # so that overlapped information is visible:
#'
#' ggplot(gapminder, aes(x = lifeExp, fill = continent)) +
#'   geom_area(stat = "bin", pos = "dodge", alpha = .6)
#'
geom_area <- function(){}
cobriant/qelp documentation built on July 1, 2022, 7:24 a.m.