Re: [R] how to get the distribution curve from a data set?

From: Daniel Folkinshteyn <dfolkins_at_gmail.com>
Date: Thu, 05 Jun 2008 16:32:48 -0400

would a density plot do? try
plot(density(x))

if you are specifically after the histogram tops rather than a density estimate, then get the hist object with plot=F, then look at the counts attribute:

histobj = hist(x, freq="TRUE", breaks=1000, plot=F) plot(histobj$counts)

hope this helps.

on 06/05/2008 03:56 PM rlearner309 said the following:
> I have a question.
> I have a data set (about 100,000 observations). How would I get the
> distribution curve graph? This is like, if I use hist(x, freq="TRUE",
> breaks=1000) to get the histogram, now the question is, I don't need the
> histogram itself, I just need the curve that connects the top of each
> histogram bin.
> Thank you very much!
>



R-help_at_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. Received on Thu 05 Jun 2008 - 21:55:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 22:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive