[THIS QUESTION IS NOT DUPLICATED! PREVIOUS ANSWER NEVER FUNCTION IN CURRENT VERSION GGPLOT2 V.3] Is it possible to yield y value of geom_density in specific x value from following script?
library(ggplot2)
data(iris)
p<-ggplot(iris,aes(x=Petal.Length))+
geom_density(aes(colour=Species),position="identity")
p
I tried R - What algorithm does geom_density() use and how to extract points/equation of curves? . but in my environment R3.5.1 and ggplot 3.1.0, that just return iris data instead of kernel density.