earth function## S3 method for class 'formula':
bagEarth(formula, data = NULL, B = 50,
summary = mean, keepX = TRUE,
..., subset, weights, na.action = na.omit)
## S3 method for class 'default':
bagEarth(x, y, weights = NULL, B = 50,
summary = mean, keepX = TRUE, ...)y ~ x1 + x2 + ...earth functionB Earth fitsNULL or the value of x, depending on the
value of keepXearth, predict.bagEarthlibrary(mda)
library(earth)
data(trees)
fit1 <- earth(trees[,-3], trees[,3])
fit2 <- bagEarth(trees[,-3], trees[,3], B = 10)Run the code above in your browser using DataLab