Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

41–50 of 266 posts

Re: Why do we use R rather than Excel?

#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 ergonomic. At my company we switched from using Python to using R for most analytical data science work because the Tidyverse tools make it so much easier to avoid bugs and weird join issues than you get in a more imperative programming environment.

[1] https://www.tidyverse.org/

Re: Why do we use R rather than Excel?

#42

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…

The joke about R is that it is great because it was written by statisticians for statisticians and that R is terrible because it was written by statisticians for statisticians.

The two best reasons to use R, IMO, are that many statisticians write up their new methods in R, so it is a window into current statistical research and practice [0], and that R is home to ggplot and the rest of the tidyverse (or Hadley-verse), a systematic approach to common data analysis tasks.

[0] https://cran.r-project.org/web/packages/available_packages_b...

[1] https://www.tidyverse.org/

Re: Why do we use R rather than Excel?

#43
Unless you need the frontier of statistical methods and are unable to code them yourself, I highly recommend not engaging R.

While Hadley Wickham has done amazing things to make the R language actually useful, Python and Julia are better for data applications. Also, bindings to the R language exist, obviating the need to be tied into it completely. Thus, even if you need the frontier, you have it available to you.

Re: Why do we use R rather than Excel?

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

rstudio is an excellent gui for R. So you can already start with R.

Re: Why do we use R rather than Excel?

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

Re: Why do we use R rather than Excel?

#47
When you are learning the basics, you are doing very basic tasks. R can do very basic tasks. MS Excel can do very basic tasks. If you never go beyond the basics, there is no compelling reason to use R (or any other programming language) over MS Excel.

Programming languages come into their own when the tasks stop being basic, but the learning process usually goes through "Hello, World" first.

I mean, if you're just going to print a line of text to the screen, why use Python? Just open an MS Word document. MS Word can even include variables and insert them dynamically!

Re: Why do we use R rather than Excel?

#48
post #23

Earlier quoted context omitted.

You might want to try out Power Query (get & transform). Step-by-step repeatable transformations where the UI records steps and writes code in the background. Almost exactly what you're talking about, and comes out-of-the-box in the last few versions.

Cool! Next time I'm opening up excel, I'll give it a look.

Also DAX and power pivot - if you think excel doesn’t have the features to reuse data sets I think you will be pleasantly surprised! This works alongside power query to create a relational data model from everything you import.

Re: Why do we use R rather than Excel?

#49
I think one of the things this is really missing is that Excel fundamentally supports 1 data structure - the table. What if your data isn't a table? What if your data is many tables? What if your data has 3 dimensions? It soon becomes incredibly difficult to map your actual problem into a set of tables.

It's actually one of excel's great features - they so strongly constrained the way you represent data that it's easy to reason about.

Re: Why do we use R rather than Excel?

#50

IMO this really asks the question: Why is there not a code view for an excel spreadsheet? I get that some of the basic operations probably create expressions that are too wordy / very "specific data" intensive. That is, if you took the first step and just did your best to create that code view it would have a lot of stuff conditional on specific things. But it's the next step that gets interesting. Now that you've go…

>Why is there not a code view for an excel spreadsheet?

There is, just press Ctrl+`. There's also dependency tracking, sort of debugger.

Post reply on HN