Live data from Hacker News

R, the master troll of statistical languages (2012)

talyarkoni.org

141–150 of 154 posts

Re: R, the master troll of statistical languages (2012)

#141
post #118

Earlier quoted context omitted.

> The problem is people using R without trying to learn about the language itself It's not the user's fault. Like, congratulations on being better at R than the author of TFA. Maybe you're smarter than him, maybe you've put in more time learning, maybe you've just spent your time more intelligently, maybe you lucked out and bought better books...who knows. But this line of reasoning completely misses the author's poi…

I think the person you are responding to is simply saying some things are more complex than others and require more understanding and experience. R apparently falls into that category. If the author wants to gain that experience, I think the time spent on this blog post may be better used to reading a book on R. Fault might be a strong word, but the author has certainly made a decision on what they spend their time o…

some things require more understanding and experience, for no obvious benefit...in which case they're anti-patterns, or not best practice in language design.

there are a lot of things in R that are good but it's an old language and there's a lot of cruft.

like "R has three object oriented systems (plus the base types), so it can be a bit intimidating." http://adv-r.had.co.nz/OO-essentials.html

and believe it or not, there are things that require looping through a data frame and when I had to do that a few years ago it was unbelievably slow... going multithreaded was non-trivial, writing that section in C was non-trivial...ended up rewriting the whole thing in python and was a lot happier.

Re: R, the master troll of statistical languages (2012)

#142

Earlier quoted context omitted.

I think the person you are responding to is simply saying some things are more complex than others and require more understanding and experience. R apparently falls into that category. If the author wants to gain that experience, I think the time spent on this blog post may be better used to reading a book on R. Fault might be a strong word, but the author has certainly made a decision on what they spend their time o…

some things require more understanding and experience, for no obvious benefit...in which case they're anti-patterns, or not best practice in language design. there are a lot of things in R that are good but it's an old language and there's a lot of cruft. like "R has three object oriented systems (plus the base types), so it can be a bit intimidating." http://adv-r.had.co.nz/OO-essentials.html and believe it or not,…

If you want to go over data-frame in parallel just replace call to lapply() with mclapply().

I agree about 3 OO systems, but let's not mix things up here. Casual user (who doesn't know sapply) doesn't interact with that.

Re: R, the master troll of statistical languages (2012)

#143
post #89

Earlier quoted context omitted.

look, I am all for RTFM but my experience with R has been a different case in my experience. Can I make it do powerful things? yes. can I take code that wont run, copy it to a new file and have it run? yes. 1) There are just quirks in implementation that are nonintuitive. I constantly find myself doing things I would do in other languages, to do simple tasks, which fail for no good reason, albeit an obvious one once…

You wouldn't find it intuitive if your first language was Scheme.

absolutely fair enough

Re: R, the master troll of statistical languages (2012)

#144
post #104
post #86

Earlier quoted context omitted.

I am in an almost identical situation, just still in the PhD stage. I moved from Matlab (originally a mechanical engineer) and the biggest shock was documentation and just the internal help stuff in general. The help files on a regular basis require you to understand how something works to understand the thing explaining how it works. I am often just shocked at little quirks I find trying to do things in R, not that…

> Oh and ' It's true that '<-' is a strange choice, but you can use '=' for variable assignments as well.

true

Re: R, the master troll of statistical languages (2012)

#145
post #78

Earlier quoted context omitted.

As character, for instance (in particular, they can do everything factors can do when used in conjunction with `unique`, and sorted factors can be represented as a conjunction of characters and numerics). Factors work better, but only barely. In particular, they are nowadays not any more efficient than using character (!). They used to be, which is why they are liberally used everywhere in R’s base libraries.

"In particular, they are nowadays not any more efficient than using character" How could a comparison of two strings of unknown size be as efficient as comparing two integers? I'm curious to learn something new.

R uses a global string cache so any string comparison is just comparing two pointers.

Re: R, the master troll of statistical languages (2012)

#146
post #112
post #86

Earlier quoted context omitted.

I am in an almost identical situation, just still in the PhD stage. I moved from Matlab (originally a mechanical engineer) and the biggest shock was documentation and just the internal help stuff in general. The help files on a regular basis require you to understand how something works to understand the thing explaining how it works. I am often just shocked at little quirks I find trying to do things in R, not that…

Iirc it comes from the old APL keyboard

well thank you, I always appreciate someone teaching me something :)

Re: R, the master troll of statistical languages (2012)

#147
post #6

Earlier quoted context omitted.

Factor is one of the worst thing of R-world. I don't recall ever needing factors, yet they creep in with many functions (read.csv, cut). Btw there's a nice readr package (from Hadleyverse) that has a read_csv method that does away with factors by default.

You must not do a lot of regression with categorical data, then. I use commands like `lm(y ~ (x1 + x2) * factor_variable, data = d)` and `xyplot(y ~ x1 | factor_1, groups = factor_2, data = d)` all the time.

Those also work just fine with strings.

Re: R, the master troll of statistical languages (2012)

#148
post #114

Writing a variant of this article has become a rite of passage for all serious users of R. There are two issues that contribute to the difficulties people experience with R. First, yes, R can be confusing at times. Tal explains this really well, but only scratches the surface. There is so much more confusing and counter-intuitive stuff, for example with regards to factors that only very few people seem to understand…

There are other books on R programming: John Chambers published "Programming with Data: A Guide to the S Language" in 1998 and "Software for Data Analysis: Programming with R" in 2008.

No better way to elicit information from people than making outrageous claims. Thanks for those references!

Re: R, the master troll of statistical languages (2012)

#149
post #146
post #112

Earlier quoted context omitted.

Iirc it comes from the old APL keyboard

well thank you, I always appreciate someone teaching me something :)

np. As was mentioned elsewhere in the thread, S is a pretty ancient language so R brings along some baggage with it :)

Re: R, the master troll of statistical languages (2012)

#150
post #127

My biggest complaint about R isn't the inconsistency and obtuseness -- I've been using it long enough to get familiar with the documentation and the zillions of varieties of apply. My problem is the data structures. R has only a few core data structures: vectors, lists, arrays, and matrices. Data frames are built on top of lists, and admittedly data frames are incredibly useful for statistics -- there's a reason pand…

The lack of data structures in R is a totally fixable problem.

Sure, through packages, but you'd need to adapt the entire standard library to take advantage of them, so you could pass new data structures to built-in functions and get meaningful results.

Generic iterators would also be extremely useful to build in, so it's easy to work with a wide variety of structures.

Post reply on HN