Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cr.setup fails if length of substitute(y) is greater than 1 #102

Open
e3bo opened this issue Jun 10, 2021 · 0 comments
Open

cr.setup fails if length of substitute(y) is greater than 1 #102

e3bo opened this issue Jun 10, 2021 · 0 comments

Comments

@e3bo
Copy link

e3bo commented Jun 10, 2021

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.

Perhaps this should be documented, or a line such as
if(length(yname) > 1) yname <- "y"
could make the function more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant