conf.int no longer working in 3.3 using ggplot2, stat_summary

旧巷老猫 提交于 2019-12-12 21:16:49

问题


I am using conf.int for the creation of boxes around a jitterplot. This had worked until upgrading R to 3.3. Is there a known fix for this?

stat_sum_df_all <- function(fun, geom="crossbar", ...) {
stat_summary(fun.data=fun, geom=geom, ...)
}


ggplot(dataset, aes(factor(Group), dataset[, y] )) + labs(y=y,     x="x") + 
    stat_sum_df_all("median_hilow",conf.int=1, linetype='solid')

Returns the following error:

Error: Unknown parameters: conf.int


回答1:


I have solved this issue by wrapping conf.int=1 with fun.args=(conf.int=1), as below:

ggplot(dataset, aes(factor(Group), dataset[, y] )) + labs(y=y,     x="x") + 
stat_sum_df_all("median_hilow",fun.args=(conf.int=1), linetype='solid')


来源:https://stackoverflow.com/questions/38272992/conf-int-no-longer-working-in-3-3-using-ggplot2-stat-summary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!