问题
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