Dear all, I am trying to plot the following table in stacked barplot in percentages and also horizontal. Component Sample 1 Sample 2 Sample 3CaO 45 52 48SiO2 25 22 18Al2O3 15 11 14TiO2 6 5 6 Na2O 5 4 5CuO 3 3 5 Cl 1 3 4 When I tried the following functionbarplot(data, + main = "Stacked bar chart", + sub = "Subtitle", + xlab = "X-lab", + ylab = "Y-lab", + axes = TRUE, horiz = TRUE) I got the following error Error in barplot.default(hellisheidi, main = "Stacked bar chart", sub = "Subtitle", : 'height' must be a vector or a matrix I also tried barplot(as.matrix(hellisheidi)) but what I was getting was the three stacked columns for Samples 1, 2 and 3 but I was getting an empty column for Component, instead of being the variable in the Samples.
I was hoping if you could help me on that. Thank you very much in advance. Kind regards,Maria
______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.