placeLevel1st: Reorder levels: place a chosen factor level as first

Description Usage Arguments Value Examples

Description

Reorder levels: place a chosen factor level as first

Usage

1
placeLevel1st(in.dt, in.col, in.s)

Arguments

in.dt

Input data.table

in.col

String with the column name that contains factors to change

in.s

String with the factor to place as first

Value

Reorders factors in a column within a dt

Examples

1
2
3
4
dt = data.table(x = 1:7, gr = factor(c('a', 'a', 'b', 'b', 'b', 'c', 'c')))

placeLevel1st(dt, 'gr', 'c')
levels(dt[['gr']])

dmattek/hcs-package documentation built on May 16, 2019, 7:24 a.m.