# computing mode of a density function in R

#### Cynderella

##### New Member
I want to compute mode of the following distribution in R.
But i think my procedure is not correct to compute it .

Code:
f <- function(x)(3/7)*x^2 #1<x<2
x=seq(1,2,length=5000)
y = f(x)
d = data.frame(x,y)
d$x[d$y==max(d\$y)]