In the end, the problem was trivial. I used base :: sort () to create factor levels. (To ensure that they will always be aligned, even if the data was in a different order)
, . R CMD , .
:
R : LC_COLLATE = en_US.UTF-8;
R CMD : LC_COLLATE = C;
:: sort :
Except for method ‘"radix"’, the sort order for character vectors
will depend on the collating sequence of the locale in use:
see ‘Comparison’. The sort order for factors is the order of their
levels (which is particularly appropriate for ordered factors).
, .
.