0

[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

output 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.

AMA
  • 174
  • 11
  • The answer in https://stackoverflow.com/questions/12394321/r-what-algorithm-does-geom-density-use-and-how-to-extract-points-equation-of did not work in my env. R 3.4.4 – AMA Nov 09 '18 at 14:43
  • I tried with R3.5.1 and also not work – AMA Nov 09 '18 at 14:56
  • I found that previous answer showed by @josh-obrien is work in ggplot2 version 2, but not in version3. – AMA Nov 09 '18 at 17:37

0 Answers0