Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

81–90 of 266 posts

Re: Why do we use R rather than Excel?

#81
post #45
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...

"Floating-point arithmetic may give inaccurate results in Excel" https://docs.microsoft.com/en-us/office/troubleshoot/excel/f... "Align numerical precision Excel 2013 and R" https://stackoverflow.com/questions/39531655/align-numerical... "Numeric precision in Microsoft Excel" https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft...

Almost all of these are issues with floating point in general, I'd say. Some are with naive implementations of Excel functions, fair enough (for example variance as (sum x_i^2/n - (sum x_i/n)^2) that are indeed better implemented in R or Julia.

IEEE 754 just has unintuitive properties.

Kahan (the "father of IEEE 754") has a rant (among many others) about Excel as well, and how it tries to hide some of the floating point complexities more or less successfully:

Floating-Point Arithmetic Besieged by “Business Decisions”

https://people.eecs.berkeley.edu/~wkahan/ARITH_17.pdf

Re: Why do we use R rather than Excel?

#82

R isn't interactive or visual like Excel. Excel's learning curve is a lot less daunting. Also, Excel is ingrained in the accounting culture and well supported by peers. Plus Excel is everyone's default database and form software. None of the article's reasons matter to non-IT people and no IT department has the juice to override the CFO and accountants. Unlike, every other interactive tool that displeases programmers…

> Plus Excel is everyone's default database and form software.

This is one of many, many things that is terribly wrong with Excel. It is arguably well suited for neither of those applications. I will continue to do my statistics in R, and be very glad that I do not work somewhere with either CFOs or powerful accountants ;-).

Re: Why do we use R rather than Excel?

#83
post #32
post #20

A while ago, there was a job offer in my area to automate Excel tasks using Python. The thing was posted time after time by several recruitment agencies, for almost a year. Just thinking how expensive that process must have been answers the question.

I spent a big part of my early career automating Excel, initially via VBA, then Interop (.net), then later via the OpenXML libraries. I actually really enjoyed it, there's something a bit magical about taking a task that takes somebody hours to do, and putting it under a single button press, or even running it overnight and having everything ready for them when they start work the next day.

That's what I'm doing right now.

The company I'm at had this process for doing salespersons commissions that would take days to do. It was painful to watch the process the first time I was trained on it. They were sorting rows manually in excel, exporting csv's from the ERP software.

Over a couple of months I worked automation into the project using SQL queries and vba/python, I even automated sending out all the personalized reports to each salesperson. Showed it to my boss last week (he had to run the reports this month) and he was blown away by how much time and energy it saved.

It felt so good to reduce a process that took days to do down to a couple of button clicks.

Re: Why do we use R rather than Excel?

#85
post #53
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...

Excel doesn't alter data without being asked either. What it does do by default is try to change how the data is displayed. If the column is properly set to the correct data type the data will be shown correctly because Excel doesn't change the actual data. Column types can be set when csv files are imported. The problem described in the article isn't an Excel issue. It is an issue of the geneticist failure to learn…

the only way to prevent Excel from converting date-like number values into 'real dates' is to format the number values as text. or escape each and every number value so this doesn't occur.

this is not just a workaround - it's recommended by Microsoft. because you literally cannot turn this functionality off.

how is that not an "Excel issue"?

Re: Why do we use R rather than Excel?

#86
post #77

Earlier quoted context omitted.

You can set the data type to "text" when importing CSVs, that turns most things off.

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".

Re: Why do we use R rather than Excel?

#87
post #71
post #61

Earlier quoted context omitted.

While that is a very real problem, it isn't totally persuasive. It is just as easy to create traps in R (I lost days of my youth to R's challenging-to-defend jungle of an almost-type-system). It is even harder to debug than in Excel too - I would expect less bugs are found in R scripts because less people are up to the challenge of trying. People shouldn't do important work in Excel. If it is important, people should…

I agree that R isn't ideal, and a proper programming language is preferable to both. Which one of course will depend on the domain, but proper control over float precision, fixed-point arithmetics, bignum and debuggability isn't good in R either. It's just that R is still far above Excel.

I mostly agree, but at least Excel is more easily inspectable by a human, which makes a certain class of errors (specifically, silly logic bugs) less likely to get through.

Re: Why do we use R rather than Excel?

#88
post #60
post #41

Earlier quoted context omitted.

I highly recommend anybody getting into R to skip the base language (which indeed is ancient and full of gotchas) and go straight for the Tidyverse[1]. You can always go back in and learn how to do things the old way later. Over the last decade, the R community has largely standardized around tools like dplyr, ggplot, tibble, purrr, and so on that make doing data science work way easier to reason about. Much more erg…

I would recommend the opposite - pick stuff from tidyverse (mostly dplyr and ggplot2) only if you need them. Knowing base R goes a long way on its own.

Pipe operator is now in base R so one of the nice features is now standard

|>

https://www.r-bloggers.com/2021/05/new-features-in-r-4-1-0/

Re: Why do we use R rather than Excel?

#89
post #32

Earlier quoted context omitted.

I spent a big part of my early career automating Excel, initially via VBA, then Interop (.net), then later via the OpenXML libraries. I actually really enjoyed it, there's something a bit magical about taking a task that takes somebody hours to do, and putting it under a single button press, or even running it overnight and having everything ready for them when they start work the next day.

That's what I'm doing right now. The company I'm at had this process for doing salespersons commissions that would take days to do. It was painful to watch the process the first time I was trained on it. They were sorting rows manually in excel, exporting csv's from the ERP software. Over a couple of months I worked automation into the project using SQL queries and vba/python, I even automated sending out all the per…

Class :)

Re: Why do we use R rather than Excel?

#90
I don't use R, and didn't read this, but I think the biggest problem with excel is that it hides the code. Figuring out which cell does what, and how, usually means clicking a million places trying to remember what is what

It's the same reason I took the doors off my pantry and cabinets

Post reply on HN