Skip to content

Instantly share code, notes, and snippets.

Created February 25, 2020 13:41
What would you like to do?
# package dependency
path_in = "new_EB with more var_2004-2016.dta"
out_tsv = "new_EB.tsv"
out_sav = "new_EB.sav"
# name repair shows the issue with _merge
x = haven::read_dta(p, .name_repair = "universal")
names(x)[ names(x) == "._merge" ] = "MERGEVAR"
haven::write_tsv(x, out_tsv) # TSV
haven::write_sav(x, out_sav) # SAV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment