News for hackers. Stuff that matters.
Re:Why do we use R rather than Excel? by roenxi on Sunday July 11, 2021 @09:53AM (#27800796)
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 be involved who have invested the time in learning something more powerful. Indeed, we could ask they aspire all the way to good practice and store their data in a database and their code in git. But there needs to be a process to verify model correctness no matter what tool is being used and bugs will exist in R as well as in Excel.

Re:Why do we use R rather than Excel? by corty on Sunday July 11, 2021 @09:59AM (#27800848)
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.
Re:Why do we use R rather than Excel? by fighterpilot on Sunday July 11, 2021 @10:15AM (#27801007)
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? by corty on Sunday July 11, 2021 @10:25AM (#27801082)
Not really. Logic in Excel is based on stuff like SUMIF( ...) which is totally unreadable without lots of context about the cell or range it refers to. If someone fumbled the fill command and some cell is missing the formula? You'll never know and the result will be automatically and silently zero. References to that result will just use the zero as input. Mixed fixed/nonfixed references like A$3? Unreadable and hard to understand. References per se? Unreadable because undescriptive, maybe there will be a column or field label, maybe there won't. Also, formulas are always hidden by default, you'll just get a sea of numbers.

Calling Excel easily inspectable is laughably wrong imho. Just the opposite.

Re:Why do we use R rather than Excel? by andy81 on Sunday July 11, 2021 @12:55PM (#27802496)
Data tables and keeping one tab per table solves all of those.

Sounds more like an issue with the skill of average excel users than a feature gap.

Re:Why do we use R rather than Excel? by jrochkind1 on Sunday July 11, 2021 @10:20AM (#27801045)
It's not obvious to me that Excel is more easibly inspectable, can you say more?

To me, R seems more easily inspectable, as all the logic of a program is visible just by looking at text files, where in Excel it's hidden "under the surface", you have to click on cells, look at what's there, go click on other cells that relate to it, remember what you were looking at in the first one that's now invisible, etc.

Re:Why do we use R rather than Excel? by fighterpilot on Sunday July 11, 2021 @10:52AM (#27801292)
It's the visualization of logic that I'm thinking of. You can press F2 on a cell and visually see what data is being pulled into the function, and you can easily manually check that that single calculation is accurate by re-creating that calculation by hand, and then infer that all the other stuff in the column is also accurate.

For anything very complicated though, I'd prefer R, as Excel eventually gets unwieldy. Although, I'm saying that from the perspective of being a reasonably experienced coder. The majority of the population should just use Excel, especially in a work context in non-technical teams. No matter how much you push for R, other people in the team aren't going to see the value and aren't going to go along with it, and your R code will be useless after you've left.

Re:Why do we use R rather than Excel? by dm319 on Sunday July 11, 2021 @06:55PM (#27805154)
Why isn't R a proper programming language? What would you use over R for data analysis or statistical analysis?

R has a beautiful functional ability based on S-expressions, allowing some clever stuff to be done (i.e. tidyverse), incredibly fast (data.table is faster than Python, Julia, Matlab etc).

Re:Why do we use R rather than Excel? by ivirshup on Sunday July 11, 2021 @10:25PM (#27806283)
Can data.table play well with the tidyverse yet?

And as a side note, I believe it's moving down the rankings in the h2o benchmarks [1].

[1]: https://h2oai.github.io/db-benchmark/

Re:Why do we use R rather than Excel? by dm319 on Monday July 12, 2021 @04:43AM (#27808322)
Oh that's great. I'm really glad to see Julia getting faster there.