character_to_ordered: Convert a character vector to an ordered factor

Description Usage Arguments

View source: R/style-guides.R

Description

Convert a vector to an ordered factor but stop if any of the values in x does not match the predefined levels in levels.

Usage

1

Arguments

x

A character vector.

levels

A vector with levels.

name

The name of the character vector to be displayed if the construction of the factor fails.


krlmlr/styler documentation built on Oct. 25, 2020, 8:13 a.m.