R/data-utils.R

Defines functions .drop_intercept

## data-utils.R: Data preparation for C++ tasks
##
## This file is part of the cvLM package.

.drop_intercept <- function(X) {
  # Identify the intercept column
  intercept.col <- which(colnames(X) == "(Intercept)")

  # Drop the intercept if it exists
  if (length(intercept.col) > 0L) {
    X <- X[, -intercept.col, drop = FALSE]
  }

  X
}

Try the cvLM package in your browser

Any scripts or data that you put into this service are public.

cvLM documentation built on Feb. 3, 2026, 5:06 p.m.