f_set: sets factor's level order

Description Usage Arguments Value Examples

View source: R/f_set.R

Description

sets levels to the order in which they appear in the data

Usage

1
f_set(x)

Arguments

x

a factor.

Value

Returns a new verision of the input factor in the order in which they appear in the data An error is raised if # unique values != length

Examples

1
f_set(factor(c("B", "A", "D"))) # Levels: B A D

STAT545-UBC-students/hw07-ziqiangt documentation built on May 24, 2019, 7:53 a.m.