Learn R Programming

DataExplorer (version 0.8.0)

plot_density: Plot density estimates

Description

Plot density estimates for each continuous feature

Usage

plot_density(data, binary_as_factor = TRUE, geom_density_args = list(),
  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

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

Run this code
# NOT RUN {
# Plot iris data
plot_density(iris, nrow = 2L, ncol = 2L)

# Plot random data
set.seed(1)
data <- data.frame(replicate(16L, rnorm(100)))
plot_density(data)

# Add color to density area
plot_density(data, geom_density_args = list("fill" = "black", "alpha" = 0.6))
# }

Run the code above in your browser using DataLab