2
0
Fork 0

fix: cve model.matrix bug

This commit is contained in:
Daniel Kapla 2020-10-21 19:01:05 +02:00
parent ad7ae9eeec
commit e93bfdda05
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ cve <- function(formula, data, method = "mean", max.dim = 10L, ...) {
# extract `X`, `Y` from `formula` with `data` # extract `X`, `Y` from `formula` with `data`
model <- stats::model.frame(formula, data) model <- stats::model.frame(formula, data)
Y <- stats::model.response(model, "double") Y <- stats::model.response(model, "double")
X <- stats::model.matrix(model) X <- stats::model.matrix(model, data)
if ("(Intercept)" %in% colnames(X)) { if ("(Intercept)" %in% colnames(X)) {
X <- X[, "(Intercept)" != colnames(X), drop = FALSE] X <- X[, "(Intercept)" != colnames(X), drop = FALSE]
} }