When I use nested function in a piping step, the order of execution seems unintuitive.
df <- data.frame(a = c(1,NA,2), b = c(NA, NA, 1))
df %>% is.na %>% colSums # Produce correct count of missing values
df %>% colSums(is.na(.)) # Produce NA
Can anyone explain why the nested function in the third line does not produce the correct result?