首页 > R中使用stat_smooth函数时,无法识别设定的参数family

R中使用stat_smooth函数时,无法识别设定的参数family

ggplot(b, aes(x=V1, y=classn)) + geom_point(position = position_jitter(width = 0.3, height = 0.06), alpha = 0.4, shape=21, size=1.5) + stat_smooth(method="glm", family="binomial")   

求解问题!控制台输出如下


P.S.已加载ggplot2包


参数不对 应该是 geom_smooth(method = "glm", method.args = list(family ="binomial"))
没有测试,仅供参考。

具体使用参数见这里 http://docs.ggplot2.org/current/geom_smooth.html

ps:ggplot2更新到了2.1 较之前的1.0有一些变化,所以网上之前的教程有部分代码跑不出来是很正常的,毕竟1.0是几年前就很多人在用~


你把原始数据集 附上。

【热门文章】
【热门文章】