Home > Software engineering >  How to list the unique categorical values of a data frame column?
How to list the unique categorical values of a data frame column?

Time:05-03

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)
  • Related