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)
vector containing data.
grouping factors
these arguments to title have useful defaults here.
vector containing color for each group. If NULL, the function "rainbow" is called.
numeric between 0 and 1. Sets the transparency of the colors
one of:
a vector giving the breakpoints between histogram cells,
a single number giving the number of cells for the histogram,
a character string naming an algorithm to compute the number of cells (see ‘Details’),
a function to compute the number of cells.
In the last three cases the number is a suggestion only.
logical: if TRUE, a legend is plotted
x position of the legend from the upper left corner
y position of the legend from the upper left corners
integer: define the symbol to visualise group colors
(points
)
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
# NOT RUN {
data(iris)
histGroup(iris$Petal.Length,iris$Species)
# }
Run the code above in your browser using DataLab