https://shkspr.mobi/blog/2021/07/why-do-we-use-r-rather-than-excel/ Terence Eden's Blog "Why do we use R rather than Excel?" 2021-07-11 by @edent | #excel #python #r | 12 comments --------------------------------------------------------------------- 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: 12 thoughts on ""Why do we use R rather than Excel?"" 1. [] Simon Chapman says: 2021-07-11 at 13:55 Excel is not benign. There are all sorts of down sides to using it for stuff it was never designed for. https://www.bbc.co.uk/news/technology-54423988 Reply 2. [1d08a308] Hacker News says: 2021-07-11 at 14:10 "Why do we use R rather than Excel?": shkspr.mobi/blog/2021/07/w... Comments: news.ycombinator.com/item?id=278002... Reply 3. [17c416c5] keithb says: 2021-07-11 at 14:48 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:-) Reply 4. [77414865] Joseph E Dante says: 2021-07-11 at 14:59 All the things you describe R can do can also be done easier in excel using VB. Reply 5. [52b17211] Matthew Cooper says: 2021-07-11 at 15:04 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. Reply 1. [cc690f63] Joe Schmoe says: 2021-07-11 at 15:55 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. Reply 1. [c6e81c59] Pomax says: 2021-07-11 at 17:01 It does, there are things like R Studio that solve that problem. Reply 6. [7c38769c] Jane says: 2021-07-11 at 16:29 My one takeaway from your reasoning is that you don really know Excel. For example, changes can easily be tracked in Excel. And batch commands can be run in Excel, as well as proper scripts. Etc. Reply 1. [b294c2c6] Duc Ottoman says: 2021-07-11 at 18:01 I agree, I was a programmer and had nothing but disdain for excel until for the last 10 years I had to do a lot of data and analytics and so I had to learn excel to things fast. excel is no longer just a tool and have all sorts of extensions to handle so much data and API integration and web services and complex mathematical derivation. I do not know R very well as a programming language ( need to know R inside out at architectural level not just as a coder consumer) but I think R or SAS or Python is not superior. Can R allow a team of 20 people working at different places collaborating code together? I have never been in a situation that R does something that ecxel cannot achieve (probably a little bit longer) i spent 2 or 3 months taking all excel and data courses from lynda.com later acquired by linkedin which in turn acquired by msft and it was my best investment of time and money. Felt like I should have taken it several years earlier rather than spendinf time with sql oracle and java c++. Unless you are in a real production house excel is just as fine Reply 7. [5c25a910] el timbero says: 2021-07-11 at 17:27 As said above, all things described here can be easily done with Excel VBA Reply 8. [f095c678] Joshua Lee says: 2021-07-11 at 17:38 The article completely misses the point of R. Go ahead. Try and run a mixed effects model with random slopes in Excel, and plot the random effects and the fixed effects in a spaghetti plot. Let me how that went. Reply 9. [482ff3d4] orion78fr says: 2021-07-11 at 19:06 The one million lines limit of excel is a pretty big reason for me. That's why some covid cases got dropped at the beggining of lockdown (: Reply Leave a Reply Cancel 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. [Post Comment] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] 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) [ ] [Ping me!] 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 [ ] Subscribe Search for: [ ] [Search] 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 * (c) Terence Eden * Contact Me * Subscribe * Citations * Support My Blog * About Me