Learn R Programming

butcher (version 0.3.5)

axe-mass: Axing a MASS discriminant analysis object.

Description

lda and qda objects are created from the MASS package, leveraged to carry out linear discriminant analysis and quadratic discriminant analysis, respectively.

Usage

# S3 method for lda
axe_env(x, verbose = FALSE, ...)

# S3 method for qda axe_env(x, verbose = FALSE, ...)

Value

Axed lda or qda object.

Arguments

x

A model object.

verbose

Print information each time an axe method is executed. Notes how much memory is released and what functions are disabled. Default is FALSE.

...

Any additional arguments related to axing.

Examples

Run this code
library(MASS)

fit_da <- function(fit_fn) {
  boop <- runif(1e6)
  fit_fn(y ~ x, data.frame(y = rep(letters[1:4], 10000), x = rnorm(40000)))
}

lda_fit <- fit_da(lda)
qda_fit <- fit_da(qda)

lda_fit_b <- butcher(lda_fit)
qda_fit_b <- butcher(qda_fit)

weigh(lda_fit)
weigh(lda_fit_b)

weigh(qda_fit)
weigh(qda_fit_b)

Run the code above in your browser using DataLab