histGroup | R Documentation |
plot a histogram for multiple groups, each group colored individually
histGroup(
data,
groups,
main = paste("Histogram of", dataname),
xlab = dataname,
ylab,
col = NULL,
alpha = 0.5,
breaks = "Sturges",
legend = TRUE,
legend.x = 80,
legend.y = 80,
legend.pch = 15,
freq = TRUE
)
data |
vector containing data. |
groups |
grouping factors |
main , xlab , ylab |
these arguments to title have useful defaults here. |
col |
vector containing color for each group. If NULL, the function "rainbow" is called. |
alpha |
numeric between 0 and 1. Sets the transparency of the colors |
breaks |
one of:
In the last three cases the number is a suggestion only. |
legend |
logical: if TRUE, a legend is plotted |
legend.x |
x position of the legend from the upper left corner |
legend.y |
y position of the legend from the upper left corners |
legend.pch |
integer: define the symbol to visualise group colors
( |
freq |
logical: if TRUE, the histogram graphic is a representation of frequencies, the counts component of the result; if FALSE, probability densities are plotted for each group. |
Just a wrapper for the function hist from the "graphics" package
Stefan Schlager
hist
data(iris)
histGroup(iris$Petal.Length,iris$Species)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.