Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

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

Gabor Grothendieck

2005-07-12

Replies:

On 7/12/05, Tan Hui Hui Jenny <medp9193@(protected):
> 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@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.