Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

151–160 of 266 posts

Re: Why do we use R rather than Excel?

#152
post #4

Big big reason: R doesn't alter data without being asked to, Excel does so, silently, sneakily. Anything important should not be done in Excel. https://www.theverge.com/2020/8/6/21355674/human-genes-renam... https://stackoverflow.com/questions/165042/stop-excel-from-a...

> Anything important should not be done in Excel. Hold on a second while I go shut down the global economy for two years so we can teach everyone finance person how to program.

finance people who learn to program will outperform those who don't.

Re: Why do we use R rather than Excel?

#153
post #40

If you need to do something once, use a GUI (Excel). If you need to do something ten times, use hotkeys and shortcuts. If you need to do something a hundred times, write a script (R). I usually use the command line as the example for why writing code and scripts are better than the more intuitive and lower-learning-curve GUIs. If I want to move a file from one folder to another then I just drag it across. Easy. If I…

I often write a script even if I only have to do something twice. In this case, the point is not to save time, it's to be secure in the knowledge that I did the thing in exactly the same way both times, because it was the same script that did it both times.

(And then it saves time anyway, because it turns out I had to do the thing 20 more times after all.)

Re: Why do we use R rather than Excel?

#154
post #40

If you need to do something once, use a GUI (Excel). If you need to do something ten times, use hotkeys and shortcuts. If you need to do something a hundred times, write a script (R). I usually use the command line as the example for why writing code and scripts are better than the more intuitive and lower-learning-curve GUIs. If I want to move a file from one folder to another then I just drag it across. Easy. If I…

Also, if you need to do something (even once) and have to know how you did it three months later, write a script.

I usually save my command history to version control every time I git commit. It helps a lot for less frequently visited projects.

Re: Why do we use R rather than Excel?

#155
post #4

Big big reason: R doesn't alter data without being asked to, Excel does so, silently, sneakily. Anything important should not be done in Excel. https://www.theverge.com/2020/8/6/21355674/human-genes-renam... https://stackoverflow.com/questions/165042/stop-excel-from-a...

There is nothing sneaky about it. Excel imports things it thinks are dates as dates. It's not a silent modification. It's a loading issue. Properly loading data into R is not particularly easy either.

Re: Why do we use R rather than Excel?

#156
post #146

Earlier quoted context omitted.

> Anything important should not be done in Excel. Hold on a second while I go shut down the global economy for two years so we can teach everyone finance person how to program.

Do not shutdown the global economy. Just maybe move to tools with less issues around process governance: "The 7 Biggest Excel Mistakes of All Time" https://www.teampay.co/insights/biggest-excel-mistakes-of-al... "The financial fails and business risks of spreadsheets" https://www.webexpenses.com/2020/10/financial-fails-business... "Nightmare on spreadsheet: take Excel use seriously" https://www.icaew.com/insights/vie…

As though mistakes wouldn’t happen with non-programmers working in R.

Re: Why do we use R rather than Excel?

#157
post #152

Earlier quoted context omitted.

> Anything important should not be done in Excel. Hold on a second while I go shut down the global economy for two years so we can teach everyone finance person how to program.

finance people who learn to program will outperform those who don't.

I believe that’s true. There still aren’t enough to go around and won’t be for a very long time.

Excel is the closest we’ve come as an industry to building a tool that enables non-programmers to program. If it disappeared tomorrow, as some arrogant posters apparently wish it would, tremendous value would be destroyed. Not just in terms of existing workflows but in terms of new workflows that would not be done in R but instead would be done by hand or not at all.

Re: Why do we use R rather than Excel?

#158
Another big one for me is speed. Almost all the popular wrangling libraries in R (tidyverse, data.table) use c++ under the hood and are lightning fast. Whereas excel can chug away for five minutes operating across a few tens or hundreds of thousands of rows; R can often do the same operations on a few millions or tens of millions of rows in a few seconds.

Re: Why do we use R rather than Excel?

#159
post #86
post #77

Earlier quoted context omitted.

Most, but not all. That is the entire point: Excel is never safe in any configuration.

Not sure about that. It is my understanding that Excel only tries to guess the type of an input if it has not been explicitly specified by the user. The problem with "things that look like dates being interpreted as dates" comes from not specifying that a column has type "text".

Even if you do specify a column as a text excel WILL assume that it contains dates sometimes.

Happened to me multiple times, even when i set each cell as a text.

Seems like copypasting a tab separated values resets the cells to their default state.

Re: Why do we use R rather than Excel?

#160
post #65

Earlier quoted context omitted.

So if I have Zip codes with leading 0’s, use R?

>So if I have Zip codes with leading 0’s, use R? Several other software tools also mess up leading 0s including R if used in a naive way without specifying extra options. My previous comment about this: https://news.ycombinator.com/item?id=25017116 Like R, MS Excel can also preserve leading 0s -- if you specify the option on import. (Click on Excel 2019 Data tab and import via "From Text/CSV" button on the ribbon men…

The problem that I've had with this issue and Excel is that Excel performs overly-clever-automagic type conversions in certain situations where you don't want them. And then especially when you're collaborating on files with non-technical normal office workers, they're not expecting this behavior. So the end result has been that this issue has bitten me many times, despite knowing how to ideally tell Excel to handle it.
Post reply on HN