Re: [R] How to obtain Frequency Tables for Histogram outputs and Frequency Polygons

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue 12 Jul 2005 - 15:12:11 EST

On 7/12/05, Tan Hui Hui Jenny <medp9193@nus.edu.sg> wrote:
> Couple of questions:
>
> 1. How can I obtain the frequency tables for a histogram chart?
> 2. Is there a short cut to obtain the frequency polygons directly without having to generate the frequency table and doing a line plot?

res <- hist(x) # res contains various data about histogram

# create red polygons using rect
plot(range(res$breaks), range(res$counts), type="n") rect(res$breaks[-length(res$breaks)],0,res$breaks[-1],res$counts, col="red")



R-help@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.html Received on Tue Jul 12 15:17:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:30 EST