Check for unordered factor
Helper to check if a factor is exclusively unordered. is.factor(x) is TRUE when x is unordered OR ordered.
is.unordered(x)
x
: a vector of dataTRUE if x is an unordered factor, FALSE if x is not a factor or is an ordered factor
is.unordered(gl(5,1)) # True is.unordered(gl(5,1,ordered = TRUE)) # False
Useful links