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.
.cstr_repair_attributes(
x,
code,
...,
ignore = NULL,
idiomatic_class = NULL,
remove = NULL,
flag_s4 = TRUE,
repair_names = FALSE
)
A character vector
The object to construct
The code constructing the object before attribute repair
Forwarded to .construct_apply()
when relevant
The attributes that shouldn't be repaired, i.e. we expect them
to be set by the constructor already in code
The class of the objects that the constructor produces,
if x
is of class idiomatic_class
there is no need to repair the class.
Attributes that should be removed, should rarely be useful.
Boolean. Whether to use asS4()
on the code of S4 objects,
set to FALSE
when a constructor that produces S4 objects was used.
Boolean. Whether to repair the names
attribute. Generally it is
generated by the constructor but it is needed for some corner cases