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!
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!