n_distinct: Compute the number of distinct unique values in a vector or...

Description Usage Arguments Value Examples

View source: R/ranges-eval.R

Description

This is a wrapper to length(unique(x)) or lengths(unique(x)) if x is a List object

Usage

1

Arguments

var

a vector of values

Value

an integer vector

Examples

1
2
3
x <- CharacterList(c("a", "b", "c", "a"),  "d")
n_distinct(x)
n_distinct(unlist(x))

plyranges documentation built on Nov. 8, 2020, 7:36 p.m.