Description Usage Arguments Author(s) See Also Examples
View source: R/ggDensity.plot.R
Create density histogram of data with a density curve overlay using ggplot2
.
1 2 3 4 5 | ggDensity.plot(data, y, facet = NULL, fill.col = NULL, line.col = "black",
scales = "fixed",
bin.width = NULL, add.line = T,
alpha.h = 1, alpha.d = .2,
fill.d = "blue")
|
data |
a dataframe |
y |
Unquoted variable name of the column in |
facet |
a character vector of one or two additional factor names by which the plot will be faceted. |
fill.col |
a character vector specifying the fill color of the histogram bars. Default is |
line.col |
a character vector specifying the line color of the histogram bars. Default is black. Specify |
scales |
a character vector specifying whether scales should be fixed across facets. Values are |
bin.width |
a numeric vector specifying the width of histogram bins. |
add.line |
logical. Should density curve be added to histogram? Default is |
alpha.h |
a numeric value between (0, 1) determining the transparency of histogram bars ( |
alpha.l |
a numeric value between (0, 1) determining the transparency of filled area under the density curve ( |
fill.d |
a character vector specifying the color of the filled area under the density curve. Specify |
Jason Grafmiller
See Also ggplot2, geom_histogram, geom_density, stat_bin
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(brown_genitives)
## plot the distribution of type-token ratios by genre
ggDensity.plot(brown_genitives, TypeTokenRatio)
## plot the distribution of type-token ratios by
## construction type
ggDensity.plot(brown_genitives, TypeTokenRatio,
facet = "Type")
## plot the distribution of type-token ratios by
## construction type and genre
ggDensity.plot(brown_genitives, TypeTokenRatio,
facet = c("Type", "Genre"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.