View source: R/summarize_data.R
tab | R Documentation |
Returned as tibble, with percentages
tab(vctr, .drop = FALSE)
tibble with columns value, n, perc
vctr <- sample(LETTERS[1:5], 1000, TRUE)
tab(vctr)
# Includes NAs count
vctr <- sample(c(LETTERS[1:5], NA), 1000, TRUE)
tab(vctr)
# For factors, by default keeps levels not present in data
vctr <- factor(
x = sample(c(LETTERS[1:5], NA), 1000, TRUE),
levels = c(LETTERS[1:5], "Levels", "not present", "in data")
)
tab(vctr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.