Live data from Hacker News

Why do we use R rather than Excel?

shkspr.mobi

241–250 of 266 posts

Re: Why do we use R rather than Excel?

#241

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

The reason to use R is because someone else has already made an amazing library(usually some kind of academic research) for it that doesn't quite exist for python yet.

There is also an aspect that if you are using a technique you don't really understand you can do the same thing in python and R and compare if the results are the same.

Re: Why do we use R rather than Excel?

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

Some years back before the prevalence of notebooks, Rmarkdown was great. More recently I have worked as a data engineer alongside some brilliant datascientists, and my understanding is there is simply some models / algorithms that are not yet implemented in common python libraries - with the draw back that on sufficiently sized data sets the R machine required to be absolutely massive as most packages did not support distributed processing.

In the end we supported an R environment and left its usage up to DS team including any ongoing reports or models and inferences they needed to perform, and encouraged a move to python for any code base that would get thrown back over the fence to us for official support.

Re: Why do we use R rather than Excel?

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

Not sure I agree with this. Most statistical analysis is a 'do once' thing, but using Excel would not be a good choice. Reproducibility and immutability of the source data are two good reasons to write a script.

Re: Why do we use R rather than Excel?

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

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?

#245

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…

If you've come from an imperative style of programming, you may end up fighting R before figuring out how it works best. It has a beautiful functional style, best demonstrated by tidyverse and map/apply functions. R has the fastest data table / tabular implementation (yes, faster than Julia), which is the standard format for most data and statistical analyses.

1 indexing is standard for numerical languages. The documentation is referenced to papers on the statistical method - I find it usually sufficient, but depends on what package you are talking about.

Re: Why do we use R rather than Excel?

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

I would say R has a beautiful functional approach which is very hard to replicate in python. It is also faster than Python and Julia for tabular/dataframe data. Ggplot is fantastic - I tried to recreate some relatively simple plots (scatterplot with a LOESS line of best fit coloured by group) and failed to do this in Python easily.

Re: Why do we use R rather than Excel?

#248

Earlier quoted context omitted.

For those who haven't used it, ctrl-r in the command line is the best thing in the world. It does a reverse-search over previous commands. Set your max history size to unlimited, and your CLI will remember /all/ commands you ever type, making it very easy to find long, strange incantations that you figured out once, so long as you can remember some small part of the command. For example, How did I do that magical ffm…

Does this work on Mac OS? I’ve got a bunch of saved notes with various incantations that would become redundant if so!

Seems like it should!

https://stackoverflow.com/questions/41780746/searching-your-...

Good to double check how to turn off the history size limit before throwing away the post it notes entirely.

Re: Why do we use R rather than Excel?

#249
post #209

Earlier quoted context omitted.

My experience is that this weird evaluation order stuff is only confusing for students with a lot of programming experience who already expect nice lexical scope. For those coming in from Excel, the tidyverse conventions are no problem and are in fact easier than all the pedantic quoting you have to do in something like Pandas. It only gets confusing when you want to write new tidyverse functions, and even then, base…

EDIT: i gotta admit, you sound like you've got more experience with teaching R than me. so perhaps my opinions here are a bit strong for what they're based on, i.e. tutoring a couple of non-programmer friends and my own learning process. still... > My experience is that this weird evaluation order stuff is only confusing for students with a lot of programming experience who already expect nice lexical scope fair poin…

It's true that if you write code that is pure and error-free then you will never bump up against R's strangeness.

But try out this bit of base R:

> hello = function(cats, dogs) { return(cats) }

> hello(100, honk) # where honk has never been defined

> hello(100, print("hello!"))

> hello(100)

Re: Why do we use R rather than Excel?

#250

Earlier quoted context omitted.

There are many circumstances in which it's not. - Remotely accessing a system (terminal or GUI). - An overloaded system (GUI response is ... inconsisstent) - Remotely accessing a system from a touch-based device. An increasingly common scenario. - Walking someone through a process (text is unambiguous). - Repeated operations (something that has to be done multiple times, in multiple directories, on an ongoing basis,…

I enjoyed your flippin' scrollbar rant! I couldn't have put it better myself.

Thanks :)
Post reply on HN