.cstr_repair_attributes {constructive}R Documentation

Repair attributes after idiomatic construction

Description

Exported for custom constructor design. In the general case an object might have more attributes than given by the idiomatic construction. .cstr_repair_attributes() sets some of those attributes and ignores others.

Usage

.cstr_repair_attributes(
  x,
  code,
  ...,
  ignore = NULL,
  idiomatic_class = NULL,
  remove = NULL,
  flag_s4 = TRUE,
  repair_names = FALSE
)

Arguments

x

The object to construct

code

The code constructing the object before attribute repair

...

Forwarded to .construct_apply() when relevant

ignore

The attributes that shouldn't be repaired, i.e. we expect them to be set by the constructor already in code

idiomatic_class

The class of the objects that the constructor produces, if x is of class idiomatic_class there is no need to repair the class.

remove

Attributes that should be removed, should rarely be useful.

flag_s4

Boolean. Whether to use asS4() on the code of S4 objects, set to FALSE when a constructor that produces S4 objects was used.

repair_names

Boolean. Whether to repair the names attribute. Generally it is generated by the constructor but it is needed for some corner cases

Value

A character vector


[Package constructive version 1.0.1 Index]