haven
haven copied to clipboard
Interaction between `.name_repair` and `col_select`
Hi,
The .name_repair
and col_select
arguments of the read_*()
functions do not interact correctly.
df <- data.frame(1:3, 1:3)
colnames(df) <- c("id", "id")
path <- tempfile()
write_sas(df, path)
read_sas(path, .name_repair = "universal", col_select = c(id...1))
Error in df_parse_sas_file(spec_data, spec_cat, encoding = encoding, catalog_encoding = catalog_encoding, :
attempt to set index 1/1 in SET_STRING_ELT
In the readr package, this behaviour works.
Thanks @olivroy! Will check it out.
Related to #685