vendorMetadata: Read and edit vendor-specific metadata
Description
Accesses statistical metadata without editing attributes directly. Replacement
returns a modified object and preserves unrelated metadata and values.
Usage
vendorMetadata(x, vendor, field = NULL)
vendorMetadata(x, vendor, field = NULL) <- value
Value
The metadata list or field; replacement returns the modified object.
Arguments
x
An R vector or data frame.
vendor
Statistical vendor.
field
One field name, or NULL for the whole list.
value
Replacement field value or named metadata list.
Details
vendor is "SPSS", "Stata" or "SAS" (case insensitive). With no
field, the getter returns the stored vendor list. With a field, it returns
that field, falling back to legacy format/width/display-width/notes attributes
only when the field is absent. A stored NULL suppresses that fallback.
Replacing one field with NULL stores an explicit clearing marker; it does not
delete the field. Replacing the whole list with NULL removes that container,
allowing legacy fallback again. Use clearFormats() or clearWidths() to
remove the corresponding fields and legacy attributes together. Replacement
validates list structure; field values are validated by the destination writer.
Dataset and column metadata use the same interface. The function does not
traverse data-frame columns: select a column explicitly to edit its metadata.