Skip to content

renamecats

Rename categories of a categorical array.

B = renamecats(A, oldnames, newnames)
B = renamecats(A, newnames)

Renames categories. With three arguments, renames the named ones. With two arguments, renames every category — newnames must have one entry per category in their canonical order.

C = categorical({'a','b'});
renamecats(C, {'a'}, {'apple'})
  • categories — List of category names in a categorical array.
  • reordercats — Reorder the categories of a categorical array.