Skip to contents

Ordered factor column maker

Usage

ord_maker(size, lvls = size/2, missing = FALSE)

Arguments

size

how many rows?

lvls

how many levels?

missing

logical, include missing?

Examples

ord_maker(size = 5, lvls = 6, missing = TRUE)
#> [1] level 1 level 2 level 3 level 4 level 5
#> Levels: level 1 < level 2 < level 3 < level 4 < level 5
ord_maker(size = 10, lvls = 5, missing = FALSE)
#>  [1] level 1 level 2 level 3 level 4 level 5 level 1 level 2 level 3 level 4
#> [10] level 5
#> Levels: level 1 < level 2 < level 3 < level 4 < level 5
ord_maker(size = 10, missing = FALSE)
#>  [1] level 1 level 2 level 3 level 4 level 5 level 1 level 2 level 3 level 4
#> [10] level 5
#> Levels: level 1 < level 2 < level 3 < level 4 < level 5
ord_maker(size = 10, lvls = 5, missing = TRUE)
#>  [1] level 1 level 2 level 3 level 4 level 5 <NA>    level 1 level 2 level 3
#> [10] level 4
#> Levels: level 1 < level 2 < level 3 < level 4 < level 5
ord_maker(size = 10, lvls = 5, missing = FALSE)
#>  [1] level 1 level 2 level 3 level 4 level 5 level 1 level 2 level 3 level 4
#> [10] level 5
#> Levels: level 1 < level 2 < level 3 < level 4 < level 5