count_distinct: Count Distinct Values

Description Usage Arguments Value Examples

View source: R/Summarize.R

Description

Count the number of distinct values in a data frame/matrix/vector. If a data frame or matrix is passed, counts the number of distinct values by column. If a vector is passed, just counts the number of distinct values.

Usage

1
count_distinct(data, use_base = TRUE)

Arguments

data

A data frame/matrix/vector.

use_base

Whether to use base R functions (i.e. length/distinct) or dplyr::n_distinct, which seems to have some performance bugs.

Value

Integer vector, named for data frames or matrixes with column names.

Examples

1
2
3

KO112/KO documentation built on Oct. 2, 2020, 9:21 a.m.