How to list (a list of distinct elements) the unique categorical values of a data frame column?
CodePudding user response:
ResultingList <- as.list(unique(df$ColumnName))
CodePudding user response:
Or with purrr
:
library(dplyr)
iris %>%
select_if(is.factor) %>%
purrr::map(unique)