The functions you should be using (e.g. colMeans) will almost all have a parameter called na.rm which defaults to FALSE. Just do colMeans(x = your_df, na.rm = TRUE) and you'll be good to go. Same with using just mean() if you want to go column by column.