-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
subset_draws duplicates variables if variables
argument contains NA
#365
Comments
Looks like an issue with the (check_existing_variables(c("mu", NA), example_draws()))
## [1] "mu" "mu" |
Great, probably not too complex of a fix then. But I also wonder if it ever makes sense to allow NA in variable. Maybe there should be an input check disallowing this? |
Yeah good point. The two options to my mind are:
I think I'd be fine with throwing an error since it probably isn't that useful to do variable subsetting by names with |
@mjskay I think your first suggestion (throwing an error if names includes NA) would make the most sense at this stage |
I agree. @n-kall would you mind making a small PR to fix this issue? |
Sure, can do |
When subsetting by variable, if
NA
is included in thevariable
argument along with other strings, the matched variables are duplicated in the output.Example:
The text was updated successfully, but these errors were encountered: