I am new to R, and I couldn't find the answers to my question in a faq. This could however be because I didn't know what to look for...:) I have three classes of data, data for bacteria, archaea and eukaryotes. I wish to display these in a histogram where all of the values are used to calculate each column. But, I want each column split in three, where the size of each coloured area represents the proportions of the values in that column that comes from each of the three classes. Do you have any tips on how I do this? Karin -- Karin Lagesen, PhD student karin.lagesen at medisin.uio.no http://www.cmbn.no/rognes/
Hi Look at ?barplot and its parameter beside. HTH Petr On 23 Sep 2005 at 10:45, Karin Lagesen wrote:> > I am new to R, and I couldn't find the answers to my question in a > faq. This could however be because I didn't know what to look for...:) > > I have three classes of data, data for bacteria, archaea and > eukaryotes. I wish to display these in a histogram where all of the > values are used to calculate each column. But, I want each column > split in three, where the size of each coloured area represents the > proportions of the values in that column that comes from each of the > three classes. Do you have any tips on how I do this? > > Karin > -- > Karin Lagesen, PhD student > karin.lagesen at medisin.uio.no > http://www.cmbn.no/rognes/ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPetr Pikal petr.pikal at precheza.cz
Karin Lagesen <karin.lagesen at medisin.uio.no> writes:> I am new to R, and I couldn't find the answers to my question in a faq. > This could however be because I didn't know what to look for...:) > > I have three classes of data, data for bacteria, archaea and eukaryotes. > I wish to display these in a histogram where all of the values are used > to calculate each column. But, I want each column split in three, where > the size of each coloured area represents the proportions of the values > in that column that comes from each of the three classes. Do you have > any tips on how I do this?Well, the thing is that a histogram tries to represent a probability distribution on the line (it is a density estimator), and the thing that you want does not; barplot() is better at this sort of job. -- O__ ---- Peter Dalgaard ??ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907