density_plot: density_plot

View source: R/density_plot.R

density_plotR Documentation

density_plot

Description

creates a density plot

Usage

density_plot(
  data,
  x,
  group = NULL,
  facet_x = NULL,
  facet_y = NULL,
  palette = ez_col,
  adjust = 1,
  alpha = 0.5,
  facet_scales = "fixed",
  facet_ncol = NULL,
  legend_ncol = NULL,
  env = parent.frame()
)

Arguments

data

A data.frame.

x

A named character value. Evaluates to a column.

group

A character value. Evaluates to a column.

facet_x

A character value. Evaluates to a column.

facet_y

A character. Evaluates to a column.

palette

Colour function.

adjust

multiplicate bandwidth adjustment

alpha

alpha

facet_scales

Option passed to scales argument in facet_wrap or facet_grid. Default is "fixed".

facet_ncol

Option passed to ncol argument in facet_wrap or facet_grid. Default is NULL.

legend_ncol

Number of columns in legend.

env

environment for evaluating expressions.

Examples

library(tsibbledata)
density_plot(mtcars, "wt", "cyl")
density_plot(subset(tsibbledata::olympic_running, Length == 100 & Year >= 1980),
             "Time", "Year - Year %% 10", "Sex", facet_scales = "free", facet_ncol = 1, adjust = 2)

ezplot documentation built on Aug. 12, 2022, 1:07 a.m.