Could someone please explain why I get different answers using the aggregate function to count missing values by group? Also, is there a better way to count missing values
library(dplyr)
library(tidyr)
#say you want to get missing values from group 1
dataframe %>% filter(group = 1 & is.na(another_column))
#missing values from group 2
dataframe %>% filter(group = 2 & is.na(another_column))