r - R中GAM模型的简单可视化
问题描述
我正在使用这个:
library(datasets)
library(ggplot2)
model <- gam(
Petal.Width ~
s(Sepal.Length)
, data = iris
, method = "REML"
)
ggplot(iris, aes(x = Petal.Width, y = Sepal.Length)) +
geom_point() +
geom_smooth(method = "gam", formula = Petal.Width ~ s(Sepal.Length))
但得到这个错误:
Warning message:
Computation failed in `stat_smooth()`:
object 'Petal.Width' not found
有任何想法吗?谢谢!
解决方案
推荐阅读
- c# - Windows 启动后应用程序找不到设置或图像文件
- c# - 如何从 XML 文件中提取嵌入的 PDF?
- python-3.x - 使用 spacy 的 POS 模式挖掘
- css - 将 3 个不相等的块左、中、右对齐
- java - 为什么它显示 Total tests run: 0, Failures: 0, Skips: 0 在终端上测试我的 testng.xml 之后,而不是在 Eclipse 上?
- mysql - Azure Application Insights Kusto 语言按时间生成值汇总
- javascript - 是否可以使用 JavaScript 悬停元素?
- google-maps - 在组件内部但在特定元素内部初始化 Google 地图
- typescript - 如何在打字稿中模拟框架对象上的击键?(不要使用 sendKeys 方法它不起作用)
- javascript - 使用js的高级表格过滤器