0

I am using the read_xlsx() function in the readxl package, though I think this applies to more functions. I believe an update to the package has made changes to the default for the .name_repair option in the function, and I'm wondering if I can do anything to easily go back to the pre-update option. Specifically, before whatever update occurred, when I used read_xlsx() and set col_names to FALSE, my column names were X__1, X__2, X__3, etc. (for however many columns there were). Now, the column names appear as ...1, ...2, ...3, etc. Do you know how I can go back to the "X__" format?

  • Reinstall the previous version of the package? Or have you read the [vignette](https://readxl.tidyverse.org/articles/articles/column-names.html) on the `.name_repair` options? – camille Apr 12 '19 at 16:48
  • Thanks for pointing me to these two things. The vignette helped me think about it more -- while it didn't have an answer, I came up with a fix (for keeping col_names as FALSE and .name_repair as "unique" when reading in the data) -- just run the following after reading in the data: names(df) <- str_replace_all(names(df), "...", "X__") But on your first suggestion -- how do you reinstall a previous version of the package? I've never done this/thought this was possible, so just curious. Thanks again for your guidance. – Alexander Agadjanian Apr 12 '19 at 18:36
  • https://stackoverflow.com/q/17082341/5325862 – camille Apr 12 '19 at 20:09
  • Thanks for flagging! I appreciate it. – Alexander Agadjanian Apr 13 '19 at 23:19

0 Answers0