plot_density: Plot density estimates

Description Usage Arguments Value See Also Examples

View source: R/plot_density.r

Description

Plot density estimates for each continuous feature

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plot_density(
  data,
  binary_as_factor = TRUE,
  geom_density_args = list(),
  scale_x = "continuous",
  title = NULL,
  ggtheme = theme_gray(),
  theme_config = list(),
  nrow = 4L,
  ncol = 4L,
  parallel = FALSE
)

Arguments

data

input data

binary_as_factor

treat binary as categorical? Default is TRUE.

geom_density_args

a list of other arguments to geom_density

scale_x

scale of x axis. See scale_x_continuous for all options. Default is continuous.

title

plot title

ggtheme

complete ggplot2 themes. The default is theme_gray.

theme_config

a list of configurations to be passed to theme.

nrow

number of rows per page. Default is 4.

ncol

number of columns per page. Default is 4.

parallel

enable parallel? Default is FALSE.

Value

invisibly return the named list of ggplot objects

See Also

geom_density plot_histogram

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Plot iris data
plot_density(iris, ncol = 2L)

# Add color to density area
plot_density(iris, geom_density_args = list("fill" = "black", "alpha" = 0.6), ncol = 2L)

# Plot skewed data on log scale
set.seed(1)
skew <- data.frame(replicate(4L, rbeta(1000, 1, 5000)))
plot_density(skew, ncol = 2L)
plot_density(skew, scale_x = "log10", ncol = 2L)

boxuancui/eda documentation built on Dec. 9, 2020, 11:11 p.m.