Closed
Description
# loading needed libraries
library(ggplot2)
library(mgcv)
#> Loading required package: nlme
#> This is mgcv 1.8-24. For overview type 'help("mgcv-package")'.
# without `::`
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
geom_smooth(method = "gam", formula = y ~ s(x, k = 3))
# with `::`
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
geom_smooth(method = "gam", formula = y ~ mgcv::s(x, k = 3))
#> Warning: Computation failed in `stat_smooth()`:
#> invalid type (list) for variable 'mgcv::s(x, k = 3)'
# this indeed a function from `mgcv package`
args(mgcv::s)
#> function (..., k = -1, fx = FALSE, bs = "tp", m = NA, by = NA,
#> xt = NULL, id = NULL, sp = NULL, pc = NULL)
#> NULL
Created on 2018-08-28 by the reprex package (v0.2.0.9000).
Metadata
Metadata
Assignees
Labels
No labels