ggDensity: Make a density plot with histogram

Description Usage Arguments Examples

View source: R/ggDensity.R

Description

Make a density plot with histogram

Usage

1
2
3
4
5
6
7
8
ggDensity(
  data,
  mapping,
  linecolor = "red",
  addhist = TRUE,
  use.label = TRUE,
  use.labels = TRUE
)

Arguments

data

a data.frame

mapping

Set of aesthetic mappings created by aes or aes_.

linecolor

Color of density curve

addhist

Whether add histogram or not

use.label

Logical. Whether or not use column label in case of labelled data

use.labels

Logical. Whether or not use value labels in case of labelled data

Examples

1
2
3
4
5
6
7
require(ggplot2)
require(moonBook)
ggDensity(acs,aes(x=age))
ggDensity(acs,aes(x=age,color=sex,fill=sex),addhist=FALSE)
ggDensity(acs,aes(x=age,color=sex,fill=sex))
ggDensity(acs,aes(x=age,fill=sex),addhist=FALSE)
ggDensity(acs,aes(x=age,color=sex))

cardiomoon/ggiraphExtra documentation built on Oct. 9, 2020, 4:16 a.m.