x <- sample(1:5, 10, TRUE)
counts(x)
props(x)
x <- quick_df(list(
a = c("a", "c", "a", "c", "d", "b"),
b = c("a", "a", "a", "c", "c", "b"),
c = c("a", "a", "a", "c", "b", "b")
))
counts(x, "a")
counts(x, c("a", "b", "c"))
props(x, 2)
props(x, 1:3)
props(c(1, 1, 3, NA, 4))
props(c(1, 1, 3, NA, 4), na.rm = TRUE)
Run the code above in your browser using DataLab