Hi all, Thank you both. The codes work perfectly.
I now use barplot(t(x.m)[-1,], names.arg = x.m[,1]) to make the 'histogram' plot. Now how do I add a dentity line to it? like 'superpose' on the graph? say if I got a Normal with mean 100 and variance 3... And I can work out the mean and variance through their definition, multiple the 'values' and the 'frequencies', sum them up and then devid by the total number, ect... Is there any codes that can deal with these count data? so that I can tell R, ''x.m[,1]" is the frequency and work out the mean, sd, ect...straightforward? Thanks! casper -- View this message in context: http://r.789695.n4.nabble.com/how-do-i-plot-this-hist-tp3032796p3034959.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list 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.