powered by
barplot
Barplot(x, by, scale = c("frequency", "percent"), style = c("divided", "parallel"), col = rainbow_hcl(length(levels(by))), xlab = deparse(substitute(x)), legend.title = deparse(substitute(by)), ylab = scale, legend.pos = "topright")
"frequency"
"percent"
"divided"
"parallel"
by
rainbow_hcl
legend
NULL
if (require(car)){ data(Mroz) with(Mroz, { Barplot(wc) Barplot(wc, by=hc) Barplot(wc, by=hc, style="parallel", scale="percent") }) }
Run the code above in your browser using DataLab