count_unique: Count how many times each unique element in a vector is...

View source: R/vector_tools.R

count_uniqueR Documentation

Count how many times each unique element in a vector is repeated

Description

Count how many times each unique element in a vector is repeated

Usage

count_unique(..., sort = FALSE, useNA = "ifany")

Arguments

...

(Vectors) Vectors that will be concatenated together.

sort

(Logical) If TRUE, the results will be sorted by decreasing count.

useNA

(Character) Include NAs in the result? Set to no, ifany, or always.

Value

A dataframe with two columns: unique which lists the unique value, and count which shows how many times that unique value appeared in ....

Examples

count_unique(sample(letters, size = 10, replace = TRUE))

#>    unique  count
#> 1       e      1
#> 2       g      1
#> 3       i      2
#> 4       m      1
#> 5       n      1
#> 6       o      1
#> 7       p      2
#> 8       y      1


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.