Re: [R] Draw curve for histogram

From: Anh Tran <popophobia_at_gmail.com>
Date: Thu, 19 Jun 2008 16:47:11 -0700

Thanks. I think I've got it. However, the density is plotted, not the frequency. Is there a way to convert the density back to frequency. Thanks a bunch.

Anh Tran

On Thu, Jun 19, 2008 at 3:33 PM, milton ruser <milton.ruser_at_gmail.com> wrote:

> Hi Anh,
>
> How about the reply by Dimitris?
>
> Kind regards,
>
> miltinho
> Brazil
>
> ---------- Forwarded message ----------
> From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
> Date: Jun 16, 2008 4:05 AM
> Subject: Re: [R] Superimposing Line over Histogram in Density Plot
> To: Gundala Viswanath <gundalav_at_gmail.com>
> Cc: r-help_at_stat.math.ethz.ch
>
> try something like this:
>
> x <- rnorm(200)
> hist(x, col = "blue")
> lines(density(x), col = "red", lwd = 2)
>
>
> I hope it helps.
>
> Best,
> Dimitris
>
> ----
> Dimitris Rizopoulos
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
>
>
>
> On 6/19/08, Anh Tran <popophobia_at_gmail.com> wrote:
>
>> Hi all,
>> What parameter should I feed to the hist function to draw a line, not bar
>> graph for a histogram? Smoothed line would be great too.
>> I've looked at curve() for normal distribution but it's not what I need. I
>> need some curve on top of the histogram (fit to the actual data). Just as
>> a
>> way to illustrate, rather than bargraph.
>>
>> Thanks
>>
>> --
>> Regards,
>> Anh Tran
>> UCLA NeuroOncology Lab
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> 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.
>>
>
>

-- 
Regards,
Anh Tran

	[[alternative HTML version deleted]]

______________________________________________
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 Fri 20 Jun 2008 - 01:22:20 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 Fri 20 Jun 2008 - 13:30:47 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