Skip to content

Support specifying XPT character variable length via "xpt.length" attribute when writing files #779

@d2yh

Description

@d2yh

Currently, when haven writes XPT files, the length of character variables is determined by the maximum length of the strings in the column. I would like to request a feature where, instead of always using the maximum observed length, haven checks for a specified attribute (e.g., "xpt.length") on the R object or column. If this attribute is present, its value should be used as the length upper limit for the character variable in the XPT file. This would provide users with more control over the output and ensure compatibility with systems that expect specific column widths.

Thank you for considering this feature!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions