Identify columns with a specific number of unique values
Source:R/column-checks.R
cols_multinary.RdThis function identifies columns in a data frame that have a specific number of unique values. It can be used to find constant, binary, ternary, or any other n-ary columns. If there are no identified columns, it will return NA.
Usage
cols_binary(data, na.rm = FALSE)
cols_ternary(data, na.rm = FALSE)
cols_multinary(data, na.rm = FALSE, n = 1)