"setdiff" operation getting reversed when using "categories" - Why??
Show older comments
I have a table named "data" with one of the variables (categorical) being "Country". I am trying to merge all the categories that are not missing ("N/A") and after executing
land = setdiff(data.Country,"N/A")
in the workspace, "land" is a 9 x 1 categorical variable. This is perfect BUT when I execute
cats = categories(land)
"cats" becomes a 10 x 1 cell which includes the "N/A" that I got rid of using "setdiff" earlier.
WHY??
I want to use the "cats" in "mergecats(data.Country, cats, "Land")". Pls help.
Accepted Answer
More Answers (0)
Categories
Find more on Categorical Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!