Closed mackerman44 closed 3 years ago
I think the difference is that any_of()
will grab any of columns you list. If you misspell one, it'll just skip that one (won't grab any column). all_of()
will return an error if that happens.
At least that's my impression reading over the tidyverse help pages.
So it seems going to all_of()
would be the safer bet? At least in this case where I would likely do a find & replace?
Yes, all_of()
will tell you when things have gone wrong, so then we can go in and fix them. any_of()
will work, we just might not realize it didn't work as well as we had hoped.
I replaced one_of() with all_of() in all functions where it was present. Tested all functions where a replacement was made and all seem to be working just fine.
Considering closed.
Low priority.
If I get a wild hair, consider replacing
one_of()
withany_of()
orall_of()
. First, need to determine ifone_of()
can universally be replaced withany_of()
. What doesall_of()
replace?