I looked for this answer for quite awhile but didn't find anything, so here it is... How can I count the number of distinct values by-column, given the following data frame?

```
> df <- data.frame(x = c(1,2,3), y = c(NA, NA, NA), z = c(NA, NA, 1))
> df
  x  y  z
1 1 NA NA
2 2 NA NA
3 3 NA  1

```