I want to know how we can write similar to sapply in dplyr. Here I am calculating no. of distinct values. I have similar multiple sapply statements so I thought to write using mutate
in dplyr.
distinctValues <- sapply(iris, function(var) dplyr::n_distinct(var))