fct_inorder: Reorder factor levels by first appearance, frequency, or...

Description Usage Arguments Examples

View source: R/reorder.R

Description

This family of functions changes only the order of the levels.

Usage

1
2
3
4
5

Arguments

f

A factor

ordered

A logical which determines the "ordered" status of the output factor. NA preserves the existing status of the factor.

Examples

1
2
3
4
5
6
7
8
f <- factor(c("b", "b", "a", "c", "c", "c"))
f
fct_inorder(f)
fct_infreq(f)

f <- factor(1:3, levels = c("3", "2", "1"))
f
fct_inseq(f)

sindribaldur/poorcats documentation built on Feb. 26, 2021, 12:27 a.m.