When called with named arguments, sets the sas.length attribute on
the specified columns. When called without arguments, returns current lengths.
If no explicit length is set, write_xpt() auto-computes lengths from
the data (8 for numeric, max byte width for character).
Value
When setting: the data frame with updated length attributes. When getting: a named integer vector of lengths.
See also
Other metadata:
get_metadata(),
set_dataset_label(),
set_format(),
set_label()
Examples
df <- data.frame(STUDYID = "S1", AGE = 65, stringsAsFactors = FALSE)
df <- set_length(df, STUDYID = 20L, AGE = 8L)
set_length(df)
#> STUDYID AGE
#> 20 8
