-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update chk_blank()
#46
Comments
Yeah, I don't think the x <- c("cat", "dog", "", "cat", NA)
chk_blank(x)
#> FALSE FALSE TRUE FALSE TRUE
y <- factor(x)
chk_blank(y)
#> FALSE FALSE LGL1 FALSE LGL2 |
I'm kind of torn - if factors are treated like character then a I'm going to treat factors like characters for the moment since that's the current behaviour, but might change my mind at some point 😛 |
Yeah, there weren't any strong intuitions in the team |
Basically the same as the srcutils change for
is_blank()
(socialresearchcentre/srcutils#95) - using%in%
is unnecessarily slow.I noticed the final
is_blank()
had a couple of extra bits there, would be good to get your feedback on these @kinto-b:stopifnot
in the character block to check for residualNA
values - I think we have a guarantee of noNA
values already because of the way we're checking, so going to leave this out.is_blank()
checks for""
in factors as well as character variables. I'm not sure how I feel about this for factors since they're conceptually quite different (i.e. I think it's reasonable to assume the user has appropriately checked their values), although this would be a breaking change.The text was updated successfully, but these errors were encountered: