Learn R Programming

campfin (version 1.0.7)

count.character: Count values in a character vector

Description

Method for dplyr::count()

Usage

# S3 method for character
count(x, sort = FALSE, prop = FALSE)

Arguments

x

A character vector.

sort

If TRUE, sort the result so that the most common values float to the top.

prop

If TRUE, compute the fraction of marginal table.

Value

A tibble of element counts

Examples

Run this code
# NOT RUN {
x <- sample(LETTERS)[rpois(1000, 10)]
table(x)
dplyr::count(x)
dplyr::count(x, sort = TRUE, prop = TRUE)
# }

Run the code above in your browser using DataLab