orderfactor: Change levels order

Description Usage Arguments Value

View source: R/utils.r

Description

This function changes the oder of the levels of a factor

Usage

1
orderfactor(x, neworder, ordered = is.ordered(x), ...)

Arguments

x

factor

neworder

numeric or character vector specifiyng the new order of the levels

ordered

logical specifying if the factor will be ordered or not (defaults to input factor class)

...

other parameters to be passed to factor function (labels, exclude)

Value

factor with levels order changed according to specifications


pezzacolori/boris-r-misc documentation built on Sept. 14, 2021, 1:46 a.m.