Using complete with a subset of levels silently drops observations #493
Labels
feature
a feature request or enhancement
help wanted ❤️
we'd love your help!
pivoting ♻️
pivot rectangular data to different "shapes"
tidy-dev-day 🤓
Tidyverse Developer Day rstd.io/tidy-dev-day
wip
work in progress
Based upon the description of complete its purpose is to add missing observations for specific combinations of variable values. I believe therefore it is not very intuitive for it to silently drop observations if certain levels are not present, for example:
This code silently drops all observations with Species = setosa
I would propose either changing the function to use a full_join() to ensure the original data is preserved or at the very least adding a warning/message so the user is aware that data has been lost.
I am happy to make a PR if people agree this is a beneficial change.
The text was updated successfully, but these errors were encountered: