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:
library(tidyr)
library(dplyr)
iris %>%
as_data_frame() %>%
mutate( Species = as.character(Species)) %>%
complete( Species = c("versicolor", "virginica"))
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.
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.