How to plot a column of columns in R?

Does anyone know how to use R to plot a histogram with columns stacked on more than 1 variable? Like the "stacked column" column in excel.

Thanks!

+3
source share
3 answers

I assume that you really need a histogram, not a histogram. In this case, both barplotfrom standard graphics or barchartfrom the grid package, both will do this. Or use ggplot as shown in this example or here

+5
source

For example:

ht1=c(0.3,0.7)
ht2=c(0.4,0.6)
barplot(cbind(ht1,ht2))
+4
source

barplot.xts xtsExtra.

+1

Source: https://habr.com/ru/post/1717809/


All Articles