Re: [R] Accessing Max/Min Value of Density Function

From: Moshe Olshansky <m_olshansky_at_yahoo.com>
Date: Mon, 16 Jun 2008 20:01:57 -0700 (PDT)


Try max(mydensity$x), max(mydensity$y), quantile(mydensity$x), etc.

See ?density

> From: Edward Wijaya <ewijaya_at_gmail.com>
> Subject: [R] Accessing Max/Min Value of Density Function
> To: r-help@r-project.org
> Received: Tuesday, 17 June, 2008, 12:16 PM
> Dear all,
>
> Currently I have the following output
>
> > mydensity <- density(x)
> > print(mydensity)
>
> x y
> Min. : -92.14 Min. :0.000e+00
> 1st Qu.: 356.66 1st Qu.:5.530e-09
> Median : 805.45 Median :4.681e-05
> Mean : 805.45 Mean :5.564e-04
> 3rd Qu.:1254.24 3rd Qu.:3.370e-04
> Max. :1703.04 Max. :5.541e-03
>
>
> How can I access the Max value of "x" or
> "y"?
> I tried this, but doesn't seem to work.
>
> > print(mydensity$y.max)
> NULL
>
> I expect it to give "5.541e-03" as output.
>
> Please advice.
>
> - E.W.
>
> ______________________________________________
> 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.



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 Tue 17 Jun 2008 - 03:04:55 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 Tue 17 Jun 2008 - 03:30:45 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