In R, use openxlsx instead of xlsx

I recently had to read an Excel spreadsheet into R.  Why Excel?  The original data were in a Google Sheet, and it appears that Google downloads everything to a .xlsx.  (There HAS to be a way to download to .csv, but I did not feel like searching.)  Opening the file – it was only 12 megabytes – in Excel and saving as .csv does not work, as Excel saves files in ANSI.  (What is that?!?!)  While it turns out you can force Excel to encode characters as UTF-8, I did not want to bother with that process at the time.  It should not be so hard, I told myself.

The most common answer was to use the xlsx package (very convenient name).    That package required me to install a Java plugin, which was super annoying.  Even after that, the file would not load, apparently because it was too big.  (12 megabytes is big data????)  Starting to get really pissed off at Google and Microsoft, I tried my luck at at the openxlsx package.  Turns out that package worked like a charm.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.