`stat_smooth()`中的计算失败:找不到对象'C_crspl'

jsb*_*jsb 5 r ggplot2 tidyverse

我正在尝试使用以下代码添加geom_smooth()到a qplot():

library(ggplot2)
library(ggplot2movies)
qplot(votes, rating, data = movies) + geom_smooth()
Run Code Online (Sandbox Code Playgroud)

但是,情节中缺少更平滑的.我还收到以下警告信息:

计算失败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
Run Code Online (Sandbox Code Playgroud)

luk*_*keA 5

我有类似的问题:

# `geom_smooth()` using method = 'gam' and formula 'y ~ s(x, bs = "cs")'
# Warning message:
# Computation failed in `stat_smooth()`:
# object 'C_crspl' not found 
Run Code Online (Sandbox Code Playgroud)

# Warning message:
# Computation failed in `stat_smooth()`:
# object 'C_magic' not found  
Run Code Online (Sandbox Code Playgroud)

当使用geom_smooth(method="gam").当我明确加载mgcv包版本时,问题就消失了1.8-17.我猜默认情况下,ggplot(我用过2.2.1.9000)看过1.8-16,这也是在搜索路径中.因此,您可能希望更新mgcv或确保使用最新版本.