Live data from Hacker News

A newcomer’s (angry) guide to R

arrgh.tim-smith.us

181–190 of 232 posts

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

#181

Earlier quoted context omitted.

Some of it is undoubtedly hyperbole, but: > Index vectors like a[1] … a[4]. All indexing in R is base-one. Note that no error is thrown if you try to access a[0]; it always returns an atomic vector of the same type but of length zero, written like numeric(0) That's serious WTF right there. In general a lot of the complaints revolve around the language making error handling unnecessarily difficult which is something t…

It's not WTF at all once you actually understand why it works that way and the benefits it provides. Subsetting in R allows for any index number to be retrieved, and if there is no value, it returns an empty value (that's what "numeric(0)" is: an empty numeric value). It's the same if you tried to access a[0] or a[90000] (in an array that doesn't have 90000 elements). This makes it easier to select multiple elements…

> It's the same if you tried to access a[0] or a[90000] (in an array that doesn't have 90000 elements).

It's not the same: `a[90000]` would be `NA` (which is a 1-element vector, not an empty vector).

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

#182
post #155

Earlier quoted context omitted.

R is a poor name, whether you can google it or not. The name can get lost in the minefield of text on the internet. Just because you never had any issues with google R does not make it any better. I have had many issues googling R and it always makes me second guess if this thread is about R language at all. On SO, I have to check if R is tagged. R is a terrible name and it is not up for a debate. Whenever you name a…

>Just to be fair, C is also a horrible name. On the other end of the spectrum - Julia and Rust are excellent names for a programming language because they're unique in the context of programming. Funny enough I most often get wrong results when googling something Rust related, because there's a town called Rust (Germany), so Google pushes the location based results up, and rust is also, well, oxidized metal, so somet…

Which is why we use "rustlang" and "golang" for keywords, tags, and search terms everywhere.

Maybe they should start using Rlang. Although it's going to be annoyingly close to erlang

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

#183

Earlier quoted context omitted.

R is fundamentally flawed. It tries to merge two highly conflicting goals: a productive analytics environment and a programming language. To do the first really well means automating away many of the issues that would crop up in the second allowing R to 'just work'. Because of that nothing beats R for getting to an answer as fast as possible (not even Python) at the cost of making it more difficult to productionise a…

And there is the mistake: production. Most people I know who use R don't care a whit about production. They run an analysis to answer hypotheses.

I agree that R shouldn't be used in production, but R is great for prototyping different analytical models before porting them over to Python or another language.

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

#184

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

Not on a personal computer, no, but the vast majority of managed systems won't let you install anything outside of your home directory. Of course you could install using `pip install --user` but you will inevitably run into problems when something you install locally needs an updated version of something installed on the system.

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

#185
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,…

My brief encounter with R led me to the exact same conclusion - that the R culture does not value correctness. That is not a characteristic I value in a development culture.

Case in point, the bug I raised about TZ handling (which is also an example of silent failure):

https://bugs.r-project.org/bugzilla/show_bug.cgi?id=16412

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

#186
post #97

Earlier quoted context omitted.

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.

Generally I've found you carry around fewer n +/- 1 type expressions when you index from 1. Also, most applied math papers I've read index from 1 and that makes implementing them a lot easier.

> Generally I've found you carry around fewer n +/- 1 type expressions when you index from 1.

I've actually found the opposite, though admittedly it doesn't come up often enough to be a major nuisance.

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

#187
post #2

I think many of the gotchas and annoying parts of base R are solved by using tools from the tidyverse: http://github.com/tidyverse . For example, the pain of needing to specify `stringsAsFactors=FALSE` is solved in the tibble package by setting a sensible default. At any rate, at least it's not Pandas and matplotlib...

I can't stand the non-standard evaluation of the tidyverse. It works great for writing one-off scripts, but as soon as you start trying to put it into functions or your own package it's just not worth the pain of quosures and the tidyeval nonsense that changes every 6 months.

I hate it as well. And then you get people going on about "functional style" while throwing referential transparency out the window.

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

#188

Earlier quoted context omitted.

Never had any trouble with `pip install --upgrade library`. Not sure if there's support for upgrading all packages at once, though.

There is no such support for multiple packages at once. R can do it though.

You can certainly update multiple packages at once using pip. Just use a requirements.txt file, which you should be doing anyway if you're using multiple packages (or just want to be able to reproduce your environment).

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

#189

Earlier quoted context omitted.

R is fundamentally flawed. It tries to merge two highly conflicting goals: a productive analytics environment and a programming language. To do the first really well means automating away many of the issues that would crop up in the second allowing R to 'just work'. Because of that nothing beats R for getting to an answer as fast as possible (not even Python) at the cost of making it more difficult to productionise a…

And there is the mistake: production. Most people I know who use R don't care a whit about production. They run an analysis to answer hypotheses.

Same here and I think that’s exactly how its meant to be used.

Even so, if you want to use R as the production system, you shouldn’t implement the jumbled spaghetti code an iterative analysis involves just for your own sanity's sake. A rewrite is always required at which point hello Python

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

#190

I use R a lot and I have to say some of these comments are weird. 1. R and Lisp are hardly alike even if it was inspire by it. It's like saying Erlang and Prolog is very similar. If you want learn FP do it in Erlang, Lisp, Haskell, etc.. Don't do it in R, it's half baked. 2. R syntax is ugly with warts. But built in datatype like dataframe, factor type, NA (missing value notion) value, make this language much better…

> R and Lisp are hardly alike even if it was inspire by it. It's like saying Erlang and Prolog is very similar. If you want learn FP do it in Erlang, Lisp, Haskell, etc.. Don't do it in R, it's half baked. They are very alike in the underlying core design, not in how you use them. In R, everything is an expression, and every expression is a function call. Even things like assignments, if/else, or function definitions…

R certainly has a lispish code-as-data element to it, but it seems like it has some serious flaws. Don't most lisps have functions and macros as separate constructs? R has functions, but with some mucking around you can make them do macro-type stuff. Then people write these half-function, half-macro things (e.g. "non-standard evalation") that tend to break composability, either totally or sometimes only in edge cases.
Post reply on HN