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.

 

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: