-
Notifications
You must be signed in to change notification settings - Fork 0
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
partial_dep() with BY argument: error for tibble X argument #92
Comments
Tibbles... Will try: if (is.data.frame(X)) {
BY <- X[[by_name]]
} else {
BY <- X[, by_name]
} This problem might occur at other places as well. I will try to fix it. |
Double brackets should work for both cases, so you should be able to avoid if statements:
|
That covers the matrix case (tibble is also a data.frame). The same error happens actually also with case weights w. |
Merged
Very good catch, thanks again! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created on 2023-10-28 with reprex v2.0.2
Root cause seems to be the different behaviour when subsetting tibbles compared to data frames, see here.
That gets done here in the code for
prepare_by()
.The text was updated successfully, but these errors were encountered: