## Not run:
# library(intubate)
# library(magrittr)
# library(mgcv)
#
# ## ntbt_bam: Generalized additive models for very large datasets
# set.seed(3)
# dat <- gamSim(1,n=25000,dist="normal",scale=20)
# bs <- "cr"
# k <- 12
#
# ## Original function to interface
# bam(y ~ s(x0, bs=bs) + s(x1, bs=bs) + s(x2, bs=bs, k=k) + s(x3, bs=bs), data = dat)
#
# ## The interface puts data as first parameter
# ntbt_bam(dat, y ~ s(x0, bs=bs) + s(x1, bs=bs) + s(x2, bs=bs, k=k) + s(x3, bs=bs))
#
# ## so it can be used easily in a pipeline.
# dat %>%
# ntbt_bam(y ~ s(x0, bs=bs) + s(x1, bs=bs) + s(x2, bs=bs, k=k) + s(x3, bs=bs))
#
#
# ## ntbt_gam: Generalized additive models with integrated smoothness estimation
# set.seed(2) ## simulate some data...
# dat <- gamSim(1, n = 400, dist = "normal", scale = 2)
# ## Original function to interface
# gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
#
# ## The interface puts data as first parameter
# ntbt_gam(dat, y ~ s(x0) + s(x1) + s(x2) + s(x3))
#
# ## so it can be used easily in a pipeline.
# dat %>%
# ntbt_gam(y ~ s(x0) + s(x1) + s(x2) + s(x3))
#
#
# ## ntbt_gamm: Generalized Additive Mixed Models
# set.seed(0)
# dat <- gamSim(1, n = 200, scale = 2)
#
# ## Original function to interface
# gamm(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
#
# ## The interface puts data as first parameter
# ntbt_gamm(dat, y ~ s(x0) + s(x1) + s(x2) + s(x3))
#
# ## so it can be used easily in a pipeline.
# dat %>%
# ntbt_gamm(y ~ s(x0) + s(x1) + s(x2) + s(x3))
# ## End(Not run)
Run the code above in your browser using DataLab