我正在尝试添加一个geom_smooth()
to a qplot()
使用以下代码:
library(ggplot2)
library(ggplot2movies)
qplot(votes, rating, data = movies) + geom_smooth()
然而,情节中缺少更平滑的部分。我还收到以下警告消息:
计算失败于stat_smooth()
: 未找到对象“C_crspl”
有人知道这里出了什么问题吗?
这是我的设置:
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
我有类似的问题:
# `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
# Warning message:
# Computation failed in `stat_smooth()`:
# object 'C_crspl' not found
and
# Warning message:
# Computation failed in `stat_smooth()`:
# object 'C_magic' not found
使用时geom_smooth(method="gam")
。当我显式加载时,问题就消失了mgcv
封装版本1.8-17
。我想默认情况下,ggplot(我使用2.2.1.9000
) 看着1.8-16
,它也在搜索路径中。所以你可能想要更新mgcv
或者确保使用最新版本。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)