Suppose I have a column in a dataframe:
A A A A B B B B B B B B B C C D D E E E E E E E E E F F F F F F F F F
How can I make a list of the factors within that column? ie:
A B C D E F
Thank you for your help.
levels(factor(df$col))
OR:
unique(df$col)
Or even:
names(table(df$col))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With