Я использую это:
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
Есть идеи?Спасибо!