Skip to content

Find x value of density plots

4 messages · Pavan G, Bert Gunter, Duncan Murdoch

#
?density
... and pay attention to the "Value" details.

-- Bert
On Tue, Dec 6, 2011 at 10:42 AM, Pavan G <pavan.namd at gmail.com> wrote:

  
    
#
On 06/12/2011 1:42 PM, Pavan G wrote:
d <- density(rnorm(1000))
plot(d)

abline(v=d$x[which.max(d$y)])

Duncan Murdoch
2 days later