title: R: how to total the number of NA in each col of data.frame
body: <p>To calculate the number of NAs in the entire data.frame, I can use <code>sum(is.na(df)</code>, however, how can I count the number of NA in each column of a big data.frame? I tried <code>apply(df, 2, function (x) sum(is.na(df$x))</code> but that didn't seem to work.</p>