Description Usage Arguments Details Examples
View source: R/density-chart.R
This function is a convinient overlay for creating a beautiful density plot using ggplot2
1 2 3 4 |
data |
data frame containing data for plotting |
x |
character string specifying name of x variable in data frame |
group |
character string for grouping of x |
title |
character string specifying chart title |
sub.title |
character string specifying chart sub title |
legend.names |
character string specifying legend names |
y.title |
character string specifying y-axis title |
x.title |
character string specifying x-axis title |
transparency |
numeric setting the level of colour transparency |
min.lim |
numeric setting minimum limit on x-axis |
max.lim |
numeric setting maximum limit on x-axis |
vline |
logical value for drawing vertical lines for the distribution median of x |
vline.custom |
numeric setting position on vertical line not tied to the distribution of x |
Group variable not ideally be a factor but the function will force class factor on the variable.
Use legend names variable to set custom labels on legends. If legend names is NULL the function will force legend names to the colnames of either x or names of groups depending on the input.
The ellipsis is used to pass on arguments to the grey_theme function. Primary use is to specify the legend.position to either "left", "right", "bottom" and "top".
Vline option specifies whether vertical lines showing the median of the distribution should be plotted.
1 2 | density_chart(mtcars, "mpg", "cyl", title = "Miles per gallon",
sub.title = "(per groups of cylinders)", vline = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.