co_relevels.Rd
Reorder Two Columns Levels Simultaneously
co_relevels(df, primary, secondary, levels_primary)
(data.frame
) with two column whose factors should be reordered.
(string
) the name of the column on which the levels reordering should be based.
(string
) the name of the column whose levels should be reordered following the levels of the
primary column.
(character
) the levels in the desired order. Existing levels that are not included will be
placed afterward in their current order.
The function expect a 1:1 matching between the elements of the two selected column.