Description Usage Arguments Details Value Author(s) See Also Examples
Interfaces to gam
functions that can be used
in a pipeline implemented by magrittr
.
1 |
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 | ## Not run:
library(intubate)
library(gam)
data(kyphosis)
## Original function to interface
fit <- gam(Kyphosis ~ s(Age,4) + Number, family = binomial, data = kyphosis,
trace = TRUE)
summary(fit)
fit <- gam(Kyphosis ~ poly(Age,2) + s(Start), data = kyphosis,
family = binomial, subset = Number > 2)
summary(fit)
fit <- gam(Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
data = airquality, na = na.gam.replace)
summary(fit)
## The interface reverses the order of data and formula
fit <- ntbt_gam(kyphosis, Kyphosis ~ s(Age,4) + Number,
family = binomial, trace = TRUE)
summary(fit)
fit <- ntbt_gam(data = kyphosis, Kyphosis ~ poly(Age,2) + s(Start),
family = binomial, subset = Number > 2)
summary(fit)
fit <- ntbt_gam(data = airquality, Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
na = na.gam.replace)
summary(fit)
## so it can be used easily in a pipeline.
library(magrittr)
kyphosis %>%
ntbt_gam(Kyphosis ~ s(Age,4) + Number,
family = binomial, trace = TRUE) %>%
summary()
kyphosis %>%
ntbt_gam(Kyphosis ~ poly(Age,2) + s(Start),
family = binomial, subset = Number > 2) %>%
summary()
airquality %>%
ntbt_gam(Ozone^(1/3) ~ lo(Solar.R) + lo(Wind, Temp),
na = na.gam.replace) %>%
summary()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.