Description Usage Arguments Details Value Author(s) Examples
Interfaces to mgcv
functions that can be used
in a pipeline implemented by magrittr
.
1 2 |
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.