strings_to_ordered_factors: strings_to_ordered_factors

Description Usage Arguments Examples

View source: R/factors.R

Description

Turn a vector of strings into a factors while keeping the existing order of elements in the vector, instead of having them automatically alphabetized.

Usage

1

Arguments

myvector

vector of character strings

Examples

1
2
mymonths <- c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
ordered_months_as_factors <- strings.to.ordered.factors(mymonths)

smach/rmiscutils documentation built on Dec. 15, 2021, 1:49 a.m.