setlevels() appears to exist at C level already but isn't exposed to users.
The advantage of setlevels() rather than users using setattr() is that setlevels() can perform error and warning checks; e.g. that the levels are type character containing no duplicates.
Requested in comments here: https://stackoverflow.com/a/14635190/403310
setlevels()appears to exist at C level already but isn't exposed to users.The advantage of
setlevels()rather than users usingsetattr()is thatsetlevels()can perform error and warning checks; e.g. that the levels are type character containing no duplicates.Requested in comments here: https://stackoverflow.com/a/14635190/403310