opts_ordered: Constructive options for class 'ordered'

View source: R/s3-ordered.R

opts_orderedR Documentation

Constructive options for class 'ordered'

Description

These options will be used on objects of class 'ordered'.

Usage

opts_ordered(
  constructor = c("ordered", "factor", "new_ordered", "next", "integer"),
  ...
)

Arguments

constructor

String. Name of the function used to construct the object, see Details section.

...

Additional options used by user defined constructors through the opts object

Details

Depending on constructor, we construct the object as follows:

  • "ordered" (default): Build the object using ordered(), levels won't be defined explicitly if they are in alphabetical order (locale dependent!)

  • "factor" : Same as above but build the object using factor() and ordered = TRUE.

  • "new_ordered" : Build the object using vctrs::new_ordered(). Levels are always defined explicitly.

  • "next" : Use the constructor for the next supported class. Call .class2() on the object to see in which order the methods will be tried.

  • "integer" : We define as an integer vector and repair attributes

Value

An object of class <constructive_options/constructive_options_ordered>


constructive documentation built on April 3, 2025, 9:39 p.m.