get("compute_group", ggplot2::StatDensity)
टाइप (या, पूर्व, get("calculate", ggplot2:::StatDensity)
) आप घनत्व की गणना करने के लिए इस्तेमाल एल्गोरिथ्म मिल जाएगा। (रूट पर, यह kernel="gaussian"
डिफ़ॉल्ट के साथ density()
के लिए एक कॉल है।)
साजिश में इस्तेमाल अंक अदृश्य print.ggplot()
द्वारा दिया जाता है, ताकि आप उन्हें इस तरह उपयोग कर सकते हैं:
library(ggplot2)
m <- ggplot(movies, aes(x = rating))
m <- m + geom_density()
p <- print(m)
head(p$data[[1]], 3)
# y x density scaled count PANEL group ymin ymax
# 1 0.0073761 1.0000 0.0073761 0.025917 433.63 1 1 0 0.0073761
# 2 0.0076527 1.0176 0.0076527 0.026888 449.88 1 1 0 0.0076527
# 3 0.0078726 1.0352 0.0078726 0.027661 462.81 1 1 0 0.0078726
## Just to show that those are the points you are after,
## extract and use them to create a lattice xyplot
library(gridExtra)
library(lattice)
mm <- xyplot(y ~x, data=p$data[[1]], type="l")
स्रोत
2012-09-12 19:00:28
मुझे लगता है कि stat_density पाया() आप पैरामीटर सेट करने के लिए अनुमति देता है। तो शायद वह पहले भाग का जवाब देता है। अभी भी जानना चाहते हैं कि समीकरण या अंक निकाले जा सकते हैं या नहीं। – unixsnob