Learn R Programming

campfin (version 1.0.9)

count.character: Count values in a character vector

Description

Method for dplyr::count()

Usage

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

Value

A tibble of element counts

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.

Examples

Run this code
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