I have a dataframe that has a scattering of NA\'s
toy_df # Y X1 X2 Label # 5 3 3 A # 3 NA 2 B # 3 NA NA C # 2 NA 6 B
I want to gr
Or in base R
aggregate(toy_df[,1:3], by=list(toy_df$Label), FUN=function(x) { sum(!is.na(x))})