You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Name conflict causes stat_smooth to fail when method = "auto" #2535
The function s in the formula y ~ s(x, bs = "cs") is (I believe) mgcv::s, but that function isn't imported (mgcv is a Suggests). The way this is set up, when there is a namespace conflict, no warning is issued (as expected) and stat_smooth fails.
s<-function(...) "A"
library(ggplot2)
data(diamonds)
myplot<- ggplot(diamonds, aes(carat,price)) + geom_smooth()
myplot#> `geom_smooth()` using method = 'gam'#> Warning: Computation failed in `stat_smooth()`:#> $ operator is invalid for atomic vectors
rm(s)
myplot#> `geom_smooth()` using method = 'gam'
s<-mgcv::smyplot#> `geom_smooth()` using method = 'gam'
Activity
lock commentedon Oct 28, 2018
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
prefix s with mgcv:: in stat-smooth.r; closes tidyverse#2535 (tidyver…