如果我想向ggridge
对象添加点估计,但我一直收到错误:
library(ggplot2)
library(ggridges)
iris_med <- iris %>% group_by(Species) %>% summarise(Sepal.Length = median(Sepal.Length))
ggplot(iris, aes(x = Sepal.Length, y = Species, fill = 0.5 - abs(0.5-..ecdf..))) +
stat_density_ridges(geom = "density_ridges_gradient", calc_ecdf = TRUE) +
geom_point(aes(x = Sepal.Length, y = Species, color = "red"), data = iris_med)
Picking joint bandwidth of 0.181
Error in eval(expr, envir, enclos) : object 'ecdf' not found
答案 0 :(得分:3)
可以通过在> qde <- SPARQL(endpoint,query)
Opening and ending tag mismatch: hr line 5 and body
Opening and ending tag mismatch: body line 3 and html
Premature end of data in tag html line 1
Error: 1: Opening and ending tag mismatch: hr line 5 and body
2: Opening and ending tag mismatch: body line 3 and html
3: Premature end of data in tag html line 1
调用中指定inherit.aes = F
来解决问题:
geom_point
只产生以下信息:
ggplot(iris, aes(x = Sepal.Length, y = Species, fill = 0.5 - abs(0.5-..ecdf..))) +
stat_density_ridges(geom = "density_ridges_gradient", calc_ecdf = TRUE) +
geom_point(aes(x = Sepal.Length, y = Species, color = "red"), data = iris_med, inherit.aes = F)
编辑:另一种方法(感谢@ Axeman的评论)是将Picking joint bandwidth of 0.181
审美移动到fill
层。