refactor: Help to refactor the factor easier

View source: R/read_data_utils.R

refactorR Documentation

Help to refactor the factor easier

Description

Help to refactor the factor easier

Usage

refactor(x, new_position = c())

Arguments

x

a character/factor vector

new_position

a integer vector specify what do you want the refactor order look like, e.g., from 1, 2, 3 to 3, 1, 2

Examples

x <- LETTERS[1:5]
refactor(x, c(5, 1:4))

kklot/ktools documentation built on Aug. 13, 2024, 7:08 p.m.