Skip to contents

Number of unique values per feature

Usage

dt_nunique_perfeat(x, excludeNA = FALSE, limit = 20L, verbosity = 1L)

Arguments

x

data.table: Input data.table.

excludeNA

Logical: If TRUE, exclude NA values.

limit

Integer: Print up to this many features. Set to -1L to print all.

verbosity

Integer: If > 0, print output to console.

Value

Named integer vector of length NCOL(x) with number of unique values per column/feature, invisibly.

Author

EDG

Examples

library(data.table)
ir <- as.data.table(iris)
dt_nunique_perfeat(ir)
#>   Sepal.Length: 35
#>    Sepal.Width: 23
#>   Petal.Length: 43
#>    Petal.Width: 22
#>        Species: 3