clearFormats() removes format.spss, format.stata and format.sas,
together with the format field in spss_metadata, stata_metadata and
sas_metadata.
clearWidths() removes the existing width and display_width attributes,
the width and display_width fields in spss_metadata, and the width
fields in stata_metadata and sas_metadata. The existing width
attribute is shared by the writers, including Stata string storage. Stata's type field is retained.
Both helpers remove matching list fields even when their value is NULL.
Clearing the corresponding existing attributes at the same time prevents
writer fallback from restoring a cleared format or width. Subsequent
exports use the writer's defaults, including formats inferred from temporal
classes and widths sufficient for string values.
Other metadata is retained, including labels, missing-value definitions,
temporal classes and units, SAS informats, SPSS measurement and alignment,
and custom attributes. A vendor list is removed when clearing its last
field; otherwise its remaining fields, including unrelated NULL fields,
are preserved. Existing empty lists are left unchanged.
For data frames, only column attributes are changed; dataset attributes
are retained. List columns are treated as individual vectors without
traversing their contents. Malformed vendor lists examined by the helper
cause an error. Inputs are not modified; assign the returned object to keep
the changes.