Skip to contents

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
)

Arguments

x

The object to construct

code

The code constructing the object before attribute reparation

...

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

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

Value

A character vector