Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

51–60 of 266 posts

Re: Why do we use R rather than Excel?

#51
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…

Agreed.

Re: Why do we use R rather than Excel?

#52

This week I got a bit more familiar with R while adding it as a scripting language for a data IDE I'm working on (it already supported other languages). It is a very hard language and community to get into! The documentation is very sparse. Library documentation is published as PDF (I guess?) and also very sparse. The default `print` behavior is pretty hard to understand. It's 1-indexed and it took me a while to real…

This is the typical „CS-people“ reaction to learning R. R is a language written by statisticians for statisticians which can be a good but also a bad thing. Fact is that R is the lingua franca of statistics, most new methods will be first available in R, rarely in python, almost never in julia. Despite the superior design of julia, there are good reasons to still use R, for example, there are many state of the art libraries such as ggplot2 or data.table which beat any alternative from python or julia.

Re: Why do we use R rather than Excel?

#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 basics of how their tools work.

Re: Why do we use R rather than Excel?

#54
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...

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

Re: Why do we use R rather than Excel?

#55
post #6

Wow those reasons don't sound very compelling to me! (I'm a programmer but don't know R.)

Honestly i struggle with it. My partner recently wrote an R package (phd biology) and I’m a developer. I had done a bit of R but nothing substantial. By the end of the project i couldn’t think of a compelling reason not to use any other language. The R tooling is clumsy, the language isn’t great…the built in graphs are ok? It feels like the reason it’s popular is mostly just people not wanting to update skills becaus…

I agree, the tooling can be clumsy. I'd wish for a language-wide standard to help with replicable R environments. Perhaps using conda makes sense here.

But when you say the language isn't great, what exactly is the problem?

IMO, R is a fascinating language from a programming perspective. The combination of first class environments, lexical scoping, non-standard evaluation and metaprogramming allows for extremely performant and expressive domain specific languages, e.g. data.table, tidyverse and ggplot.

Re: Why do we use R rather than Excel?

#57

I think a fairer question today would be "Why do we use R rather than M?" https://www.howtoexcel.org/power-query/m-code/

Absolutely! For power-users of Excel, this article reads as "the reason we don't use Excel is because we don't understand how to use it".

For those who aren't as familiar with Excel, all the functionality the author is describing as missing in Excel is actually built into it out of the box - as a feature called Get & Transform (or 'PowerQuery'). You can load in a CSV, manipulate it, do batch processing, and all the steps are visible, editable, resequencable and deletable (showing you the M code behind it!).

You can even handle hundreds of millions of records this way.

For those who want to learn, I would wholeheartedly recommend this book: https://www.amazon.co.uk/Power-Pivot-Bi-Excel-2010-2016/dp/1...

Re: Why do we use R rather than Excel?

#58
post #26

There is no reason to use R when Excel can do the jobs. It is when Excel can’t handle the task at hand, R shines. I am well familiar with R, but for simple data manipulation, quick chart, pivot table, usually resort to a spreadsheet program. I maintain my Options Trading Journal in spreadsheet where I record all the Options trade I made, positions I hold, P&L, etc. I just can’t imagine doing that in R. R starts with…

How do you store your surface?

Re: Why do we use R rather than Excel?

#60
post #41

This week I got a bit more familiar with R while adding it as a scripting language for a data IDE I'm working on (it already supported other languages). It is a very hard language and community to get into! The documentation is very sparse. Library documentation is published as PDF (I guess?) and also very sparse. The default `print` behavior is pretty hard to understand. It's 1-indexed and it took me a while to real…

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.
Post reply on HN