Learn R Programming

butcher (version 0.3.5)

axe-mda: Axing a mda.

Description

mda and fda objects are created from the mda package, leveraged to carry out mixture discriminant analysis and flexible discriminat analysis, respectively.

Usage

# S3 method for mda
axe_call(x, verbose = FALSE, ...)

# S3 method for fda axe_call(x, verbose = FALSE, ...)

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

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

# S3 method for mda axe_fitted(x, verbose = FALSE, ...)

# S3 method for fda axe_fitted(x, verbose = FALSE, ...)

Value

Axed mda 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
if (FALSE) { # rlang::is_installed("mda")
library(mda)

mtcars$cyl <- as.factor(mtcars$cyl)

fit <- mda(cyl ~ ., data = mtcars)
out <- butcher(fit, verbose = TRUE)

fit2 <- fda(cyl ~ ., data = mtcars)
out2 <- butcher(fit2, verbose = TRUE)

# Another mda object
data(glass)
wrapped_mda <- function(fit_fn) {
  some_junk_in_environment <- runif(1e6)
  fit <- fit_fn(Type ~ ., data = glass)
  return(fit)
}

lobstr::obj_size(wrapped_mda(mda))
lobstr::obj_size(butcher(wrapped_mda(mda)))

lobstr::obj_size(wrapped_mda(fda))
lobstr::obj_size(butcher(wrapped_mda(fda)))
}

Run the code above in your browser using DataLab