Skip to content

Commit 61d3a99

Browse files
committed
Don't keep the names that model.response() adds to a vector response
1 parent 4268ab8 commit 61d3a99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/convert_data.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ convert_form_to_xy_fit <-function(
5757
# cbound numeric columns, factors, Surv objects, etc).
5858
y <- model.response(mod_frame, type = "any")
5959

60+
# if y is a numeric vector, model.response() added names
61+
if(is.atomic(y)) {
62+
names(y) <- NULL
63+
}
64+
6065
w <- as.vector(model.weights(mod_frame))
6166
if (!is.null(w) && !is.numeric(w))
6267
stop("'weights' must be a numeric vector", call. = FALSE)

0 commit comments

Comments
 (0)