I recently had cause to take a beginners course in R - a language I'm fairly familiar with.
One of the other students had never used it before, so we were buddied up in order for me to show them the ropes.
The first lesson of R is always the same. Read a CSV, manipulate it a bit, draw a graph. We did it all without much fuss - and a graph appeared on screen. Nifty!
"I don't get it," the student said, "Why wouldn't you just use Excel for this?"
To a programmer, it seems obvious - but it's a fair question! If you have a static set of data, you can drag your mouse over it, hit a few buttons, and a graph appears. Much easier than wrestling with esoteric syntax in a text-based interface. This isn't a Koan - where the student becomes enlightened at the end. It's a tricky question to answer. Here are the reasons I gave - feel free to add your own.
Visibility
How do you see the code inside an Excel document? How do you tell exactly what is going on? You have to go clicking through cells, or reverse engineer what settings a graph has.
With something like R, you automatically have all the code visible in front of you. Reading through the code in a linear fashion is possible. You can trace exactly what the code is doing without having to worry about whether there's some code hidden in cell Z44.
Track Changes
Related to the above, it's hard to visualise what changes have been made to an Excel document. I don't know any way to easily see how a formula has changed. With R and Git (or any other version control system) you can see exactly what has changed from one version to the next.
Repeatability
Typically, a user draws a graph on a single Excel document. If you want the same graph of a different data set, you're out of luck. You can copy the data from one Excel sheet into another - but there's no way to easily copy a bunch of manipulations and graph configurations to another document.
With R, you just change read.csv("1.csv")
to read.csv("2.csv")
and the exact same calculations are run on two different data sets.
Batch processing
Related to the above, you can read every CSV in a directory and produce a graph for each of them. You can read data from an API and run the same process on it that you did yesterday.
Extensibility
Excel has a wide range of graphs available - but R has more. Excel can do basic analysis - but R can do extensive, complex analysis. Excel has some decent tooling - but R has thousands of libraries which can do a bewildering array of clever stuff.
What else?
Those were the advantages that I could think of on the spur of the moment. Perhaps you can think of more.
But what I learned was that it is decidedly non-obvious why a user would want to use something like R or Python when Excel (seemingly) covers all the basics.
❦More posts from around the site:
6 thoughts on ""Why do we use R rather than Excel?""
- Simon Chapman says:
Excel is not benign. There are all sorts of down sides to using it for stuff it was never designed for.
- Hacker News says:
"Why do we use R rather than Excel?": shkspr.mobi/blog/2021/07/w… Comments: news.ycombinator.com/item?id=278002…
- keithb says:
http://www.eusprig.org/stories.htm
The news stories above will provide some examples of why a script producing a report is safer than sending a spreadsheet around! The same organisation did a paper some time ago claiming a 5% error rate on spreadsheet entries.
I see the spreadsheet as a sketchbook and a script as a finished work (possibly in oils:-)
- Joseph E Dante says:
All the things you describe R can do can also be done easier in excel using VB.
- Matthew Cooper says:
I've led courses on spatial data analysis and mapping using Excel+QGIS, as well as using R, sometimes covering both in one course. Its definitely hard to convince students the value of R when they are used to being able to see and interact more directly with data.
I usually explain that using Excel + QGIS is like baking a cake yourself. You do all the steps yourself, and if you realize at the end you forgot to add eggs, you have to throw the cake out and start all over again.
Using R, on the other hand, is like writing a recipe. If you forgot a key ingredient, fixing the recipe is as simple as adding it to the list of ingredients. The catch is that you hand the recipe to a very stupid and literal chef, so you must specify everything in the recipe perfectly.
- Joe Schmoe says:
value of R when they are used to being able to see and interact more directly with data.
Does R not have an easy to visualize repl like Jupyter Notebooks for python? It's pretty direct interaction with great visibility, at least with pandas and matplot.
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
Email *
Website
Notify me of follow-up comments by email.
Notify me of new posts by email.
To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)
Subscribe to Blog via Email
Enter your email address to subscribe to this blog and receive notifications of new posts by email.
Join 12,196 other subscribers.
Email Address
Explore The Archives
2021 | ||
---|---|---|
January 31 posts | February 28 posts | March 31 posts |
April 30 posts | May 31 posts | June 30 posts |
July 11 posts | August | September |
October | November | December |
2020 | ||
---|---|---|
January 31 posts | February 29 posts | March 31 posts |
April 30 posts | May 31 posts | June 30 posts |
July 31 posts | August 31 posts | September 30 posts |
October 31 posts | November 30 posts | December 31 posts |
2019 | ||
---|---|---|
January 31 posts | February 12 posts | March 17 posts |
April 12 posts | May 12 posts | June 10 posts |
July 7 posts | August 5 posts | September 6 posts |
October 14 posts | November 30 posts | December 17 posts |
2018 | ||
---|---|---|
January 8 posts | February 4 posts | March 6 posts |
April 14 posts | May 5 posts | June 6 posts |
July 6 posts | August 13 posts | September 14 posts |
October 8 posts | November 30 posts | December 4 posts |
2017 | ||
---|---|---|
January 12 posts | February 9 posts | March 8 posts |
April 4 posts | May 10 posts | June 5 posts |
July 5 posts | August 6 posts | September 3 posts |
October 4 posts | November 30 posts | December |
2016 | ||
---|---|---|
January 10 posts | February 10 posts | March 11 posts |
April 9 posts | May 8 posts | June 9 posts |
July 6 posts | August 9 posts | September 4 posts |
October 2 posts | November 30 posts | December 14 posts |
2015 | ||
---|---|---|
January 8 posts | February 11 posts | March 10 posts |
April 4 posts | May 9 posts | June 3 posts |
July 7 posts | August 9 posts | September 10 posts |
October 2 posts | November 30 posts | December 4 posts |
2014 | ||
---|---|---|
January 13 posts | February 13 posts | March 14 posts |
April 14 posts | May 7 posts | June 7 posts |
July 9 posts | August 5 posts | September 5 posts |
October 1 post | November 30 posts | December 20 posts |
2013 | ||
---|---|---|
January 25 posts | February 17 posts | March 15 posts |
April 18 posts | May 11 posts | June 14 posts |
July 6 posts | August 14 posts | September 6 posts |
October 4 posts | November 30 posts | December 14 posts |
2012 | ||
---|---|---|
January 14 posts | February 8 posts | March 13 posts |
April 15 posts | May 10 posts | June 16 posts |
July 8 posts | August 8 posts | September 6 posts |
October 6 posts | November 30 posts | December 31 posts |
2011 | ||
---|---|---|
January 13 posts | February 11 posts | March 11 posts |
April 12 posts | May 8 posts | June 8 posts |
July 6 posts | August 5 posts | September 11 posts |
October 7 posts | November 30 posts | December 17 posts |
2010 | ||
---|---|---|
January 6 posts | February 15 posts | March 12 posts |
April 13 posts | May 4 posts | June 3 posts |
July 15 posts | August 8 posts | September 11 posts |
October 9 posts | November 30 posts | December 9 posts |
2009 | ||
---|---|---|
January 1 post | February 5 posts | March 3 posts |
April 7 posts | May 12 posts | June 8 posts |
July 10 posts | August 10 posts | September 12 posts |
October 22 posts | November 31 posts | December 15 posts |
2008 | ||
---|---|---|
January 2 posts | February | March 2 posts |
April 3 posts | May 2 posts | June |
July 1 post | August 3 posts | September 1 post |
October 3 posts | November 2 posts | December 1 post |
2007 | ||
---|---|---|
January | February | March |
April | May | June |
July | August | September |
October | November 4 posts | December 5 posts |
2006 | ||
---|---|---|
January | February | March |
April 1 post | May | June |
July | August | September |
October | November 1 post | December |
2005 | ||
---|---|---|
January | February | March 1 post |
April | May | June |
July | August | September 1 post |
October | November | December |
2004 | ||
---|---|---|
January | February | March |
April | May 5 posts | June 3 posts |
July 1 post | August | September |
October | November | December |
2003 | ||
---|---|---|
January | February | March 2 posts |
April | May | June |
July | August | September |
October | November | December |
2002 | ||
---|---|---|
January | February 1 post | March |
April 3 posts | May | June |
July | August | September |
October | November | December |
2001 | ||
---|---|---|
January | February | March |
April | May | June |
July 1 post | August | September |
October 1 post | November | December |
2000 | ||
---|---|---|
January | February | March 1 post |
April | May | June |
July | August | September |
October | November 1 post | December |
1999 | ||
---|---|---|
January | February | March |
April | May | June |
July | August | September 1 post |
October | November | December 1 post |
1995 | ||
---|---|---|
January | February | March 1 post |
April | May | June |
July | August | September |
October | November | December |
1987 | ||
---|---|---|
January | February | March |
April | May | June |
July | August | September |
October | November | December 1 post |