Skip to contents

Get number of unique values per features

Usage

df_nunique_perfeat(x, excludeNA = FALSE)

Arguments

x

matrix or data frame input

excludeNA

Logical: If TRUE, exclude NA values from unique count.

Value

Vector, integer of length NCOL(x) with number of unique values per column/feature

Author

EDG

Examples

df_nunique_perfeat(iris)
#> Sepal.Length  Sepal.Width Petal.Length  Petal.Width      Species 
#>           35           23           43           22            3