Live data from Hacker News

A newcomer’s (angry) guide to R

arrgh.tim-smith.us

101–110 of 232 posts

Re: A newcomer’s (angry) guide to R

#101
itt: crying about some rando's opinions.

dude's venting (on his own blog) after what sounds like a legitimately frustrating experience and trying turn it into a productive exercise.

if that offends your delicate sensibilities, i'm sorry. consider logging off instead of grandstanding about "grandstanding."

Re: A newcomer’s (angry) guide to R

#102
If you have tried R and found it painful I can’t say enough good things about the “R for Data Science” book. Great overview of Tidyverse, ggplot. After 50 pages I was further along than my previous 5 years of googling and cursing.

Re: A newcomer’s (angry) guide to R

#103
post #60
post #50

I don't understand why HN hates R. HN loves lisp, and R as a language shares a much greater affinity with lisp languages than python or Go do. The language was born out of the original authors reading SICP (as statisticians). Sure, many of the users of R molded it to look like what they were used to (S), but that just highlights the powerful metaprogramming capabilities of the language.

I won't speak for HN, but here's a tongue in cheek summary of my experience with R. I write a script. It doesn't work. I don't know why. I look at the error message, and then google for 30 minutes to understand what it really means - which parts of the code broke, why, how to fix them. Because none of the 3 things (which, why, how) is easy to get to. OK, I fix it, having learned something new (like that there are inf…

Sounds like you aren't running your scripts as scripts. If you source a script or run it via Rscript it will halt when it hits a failure (unless you've changed a default). Copying and pasting in to the REPL will hide errors like you describe.

The other part is that it sounds like you don't have a standardized R environment. I admit that R's tooling there isn't the best, but there are options, e.g. {packrat} & {lockbox}... or better yet a Docker image.

Re: A newcomer’s (angry) guide to R

#104

Earlier quoted context omitted.

From your experience what makes data.table so useful?

the grammar of data.table is a bit similar to SQL, and I find that it's easier to quickly write something vs piping in dplyr

Plus I don't have to remember a lot of function names and what order to input vars to the functions. Just have a remember the data.table index syntax and I can do a lot of stuff. I'm sure I can do dplyr once I learn the functions but the data.table syntax seems very simple and elegant to me.

Re: A newcomer’s (angry) guide to R

#105
post #97

Earlier quoted context omitted.

One common thing across most the "real" programming languages makes them unfit for data work: 0-based indexing. It is just ridiculous to call the first row in a data set as 0th row, and the last row as (n-1)th row. It does not make any sense for data analytic work.

I'm not sure I understand this, and I'm genuinely interested in why it would be. I find zero indexing logical: zero is the first natural number and is thus a fine candidate for being the first ordinal. In my experience most mathematical series lose nothing in terms of elegance or readability by being indexed from zero instead of using more traditional indexing from one.

You find zero indexing logical most likely because you learned programming on languages which are zero-based. But most of the rest of the population, including statisticians, for which R is the intended audience, likely start at one and aren't used to OB1 errors.

Re: A newcomer’s (angry) guide to R

#106
post #97

Earlier quoted context omitted.

One common thing across most the "real" programming languages makes them unfit for data work: 0-based indexing. It is just ridiculous to call the first row in a data set as 0th row, and the last row as (n-1)th row. It does not make any sense for data analytic work.

I'm not sure I understand this, and I'm genuinely interested in why it would be. I find zero indexing logical: zero is the first natural number and is thus a fine candidate for being the first ordinal. In my experience most mathematical series lose nothing in terms of elegance or readability by being indexed from zero instead of using more traditional indexing from one.

It seems needlessly confusing to me to refer to the first number in a series as the 0th number. 0-based indexing is only good for offset counting, which is very much based on having a mental model based on pointer arithmetic for a number sequence.

Re: A newcomer’s (angry) guide to R

#107

Earlier quoted context omitted.

Well pip install library needs root, which you probably don't have. So now you have to teach them about making, and acitvating, virtual environments. Also, they can't easily search through the packages in a nice GUI and just click on the one they want to install.

>pip install library needs root Hmm, not really. It's actually advised against [1]. [1] - https://askubuntu.com/questions/802544/is-sudo-pip-install-s...

Pip install needs root on my ubuntu install, my lab's and university's old redhat servers and my windows for linux install. I've had to install anaconda python to get any real work done on all three systems. Anaconda works fine for me but I've not even had to think about anything to install packages in R.

Re: A newcomer’s (angry) guide to R

#108
I use R most of the time and I find R notebooks very data exploration friendly. It makes it easy to back and forth just like Jupyter notebook. Producing HTML files from Rmarkdown files is also analysis friendly.

99% of the time I use tidyverse with no noticeable impact on the performance. For that occasional 1%, I must admit datatable package works out really well. tidyverse pipes are so unixy that makes it easy to transition to command such as cut, head, sort and column if needed without any mental contortion.

I have used Python occasionally and with method chaining, it can almost simulate the "dplyr" like syntax. However, it is hard to find some obscure statistical test out of the box which is easy in R.

Re: A newcomer’s (angry) guide to R

#109
post #50

I don't understand why HN hates R. HN loves lisp, and R as a language shares a much greater affinity with lisp languages than python or Go do. The language was born out of the original authors reading SICP (as statisticians). Sure, many of the users of R molded it to look like what they were used to (S), but that just highlights the powerful metaprogramming capabilities of the language.

Whoa there.

I use lisp and R. While R evolved from lisp, which let's me understand how it does certain things, I don't know if I'd describe it as more like lisp than python.

Indeed, the analogy I use to describe to friends why I have a strong emotional distaste for R is to use the following analogy:

Imagine you grew up as a heterosexual male. In your early years, you have fond memories of a young girl whom you had a fling with.

She drops off your radar, and you run into her 30 years later. She's gotten breast implants, botched her face with plastic surgery, and went through a rather traumatic divorce and reinvention of herself.

To your friends who lived on an island where there were no women and kept in basements and were regularly beaten by other stats programs, she might even be beautiful, and she certainly pays them attention to their base desires that they crave.

To you, she'll always be a mangled shadow of her former self and what could have been...

Re: A newcomer’s (angry) guide to R

#110
post #19

HN is predisposed to hate R because everyone here is coming from a "real" programming context. Their concerns are generally valid, but they should keep in mind a lot of people using do not have a software development background and do not care that the language is not elegantly designed: they just want to get analytical work done. In that respect, R is far, far superior to Python. Even something as simple as installi…

No, you are wrong. R is terrible , and especially so for non-professional programmers, and it is an absolute disaster for the applications where it routinely gets used, namely statistics for scientific applications. The reason is its strong tendency to fail silently (and, with RStudio, to frequently keep going even when it does fail.) As a result, people get garbage results without realizing , and if they're unlucky,…

Silent failure and continuing to run on errors are common in interpreted languages. SAS has similar issues, most RDBMSs will continue to process queries after failures. It’s something you need to explicitly guard against.
Post reply on HN