opts_collector: Constructive options for class 'collector'

View source: R/s3-collector.R

opts_collectorR Documentation

Constructive options for class 'collector'

Description

These options will be used on objects of class 'collector', i.e. column specifications as created by readr::col_double(), readr::col_date(), readr::col_factor() etc. They all share the class 'collector' and a subclass ⁠collector_<type>⁠ that maps to the constructor ⁠readr::col_<type>()⁠.

Usage

opts_collector(constructor = c("col", "next", "list"), ...)

Arguments

constructor

String. Name of the function used to construct the object.

...

Additional options used by user defined constructors through the opts object

Details

Depending on constructor, we construct the object as follows:

  • "col" (default): We build the object using the relevant ⁠readr::col_*()⁠ function, e.g. readr::col_double() or readr::col_date(format = "%Y"), providing only non default arguments.

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

  • "list" : We define as a list and repair attributes

Value

An object of class <constructive_options/constructive_options_collector>


constructive documentation built on Oct. 22, 2026, 5:07 p.m.