Open e3bo opened 3 years ago
Minimal example:
data <- data.frame(y = c(1, 2, 3)) rms::cr.setup(data$y)
produces
Error in factor(cuts, levels = 0:(kint - 1), labels = labels) : invalid 'labels'; length 4 should be 1 or 2
while with(data, rms::cr.setup(y)) works as expected.
with(data, rms::cr.setup(y))
Perhaps this should be documented, or a line such as if(length(yname) > 1) yname <- "y" could make the function more robust.
if(length(yname) > 1) yname <- "y"
Minimal example:
produces
while
with(data, rms::cr.setup(y))
works as expected.Perhaps this should be documented, or a line such as
if(length(yname) > 1) yname <- "y"
could make the function more robust.