Live data from Hacker News

A newcomer’s (angry) guide to R

arrgh.tim-smith.us

31–40 of 232 posts

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

#31

Earlier quoted context omitted.

>> This is a very bad example of what factors are for in R, because it makes it seem like factors are for defining variables or keys in key value pairs > That is the approach for tidy data, which is used a lot in the R tidyverse ( http://tidyr.tidyverse.org/articles/tidy-data.html ) Do you have a reference to where Hadley et al. suggest using factors in a key-value system? I'm reading Wickham's books at the moment an…

It was my interpretation of the original article quote that it was referring to tidy schema, but I could be incorrect. (the gather() function of tidyr names its parameters key and value as well, and the function is described as "Gather columns into key-value pairs": http://tidyr.tidyverse.org/reference/gather.html )

If you are interested in this topic and haven't seen Advanced R, I'd recommend taking a look - the book explains why those functions have key-value pairs as parameter names. Note that the functions you cite aren't related to factors.

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

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

It's also worth noting that R becomes much more pleasurable with the Tidyverse libraries. The pipe alone makes everything more readable.

I'm also coming from more of an office setting where everything is in Excel. I've used R to reorganize and tidy up Excel files a lot. Ggplot2 (part of the Tidyverse) is also fantastic for plotting, the grammar of graphics makes it really easy to make nice and slightly complex graphs. Compared to my Matplotlib experiences, it's night and day. Though I'd expect my experience with programming to be quite different from others' though, mainly because any code I write is basically an intermediary step before the output goes back in Excel.

That said, if anyone's interested in learning R from a beginner's level, I can recommend the book R for Data Science. It's available freely at http://r4ds.had.co.nz/ and the author also wrote ggplot2, RStudio, and several of the other Tidyverse libraries.

EDIT: I'm also currently writing my master's thesis in RMarkdown with the Thesisdown package. It's wonderful, it allows for using Latex without really knowing Latex which is great for us in business school.

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

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

>>Have you ever tried explaining the various python package and environment management options to someone with a background in Excel/SQL?

Yes, well, from the outside it doesn't seem like Python programmers have any better grasp of those either.

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

#34
I don’t hate R as much as I hate universities insisting on mandatory use of R for all comp-stat courses. This to my mind verges on civil rights infringements. Bear in mind we aren’t talking about a private institution such as a company, where when you sign on as a dev for a paycheck, you do so voluntarily, knowing that the company uses X language and you won’t have a choice in the matter. In a public university, students, especially grad students, who go on to do research and write papers etc., must have a choice in what they use. If I don’t like R, doesn’t matter what the reasons behind my dislike, I should have a choice. Let me use numpy, scipy.stats and pandas. How does that bother you ? First of all, you should be teaching statistical concepts, not syntax - so this whole notion that graders & TAs don’t know python is nonsense. Let them grade my numerical answers, not the R syntax used to get that answer. And at that point, how does it matter if I use R or python to get my answers ? Sorry, had to get that off my chest ( and don’t even get me started about sas )

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

#35

Having used Python, JSL, Julia, R and Matlab; I agree with most of the things in R. R is an extremely ugly language. It seems to be created by people who wear capris and uggs (both at the same time). But, R has incredible packages, especially the work done by Hadley Wickam. ggplot2 is beautiful. It is utterly gorgeous. It is what Ted Baker is to the capri guys that designed the language itself.

ggplot2 produces beautiful graphs. I don't think it's beautiful as a package -- the syntax is strange and reflects an earlier evolution of the ideas that went into the tidyverse. Notably the use of + instead of chaining operators, the use of a custom "ggproto" object system instead of S3 (which makes extensibility a nightmare), and the superfluous presence of the aes() function (rendered unnecessary by better lazy ev…

> the superfluous presence of the aes() function (rendered unnecessary by better lazy evaluation tricks not really well-explored at the time)

I find this statement interesting - the aes() function helped distinguish attributes that were bound to values as opposed to being bound to constants. What would you propose as an alternative if the aes() function were eliminated?

EDIT:

Looking at ggviz [1], the presumptive successor to ggplot2, it seems that two new syntactic features will be used to distinguish constant vs. bound data.

[1] https://ggvis.rstudio.com/ggvis-basics.html

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

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

Another feature for this audience is the philosophy that functions shouldn't have side effects. You can still do (several types) of object oriented programming in R, but it does take away some of the ways in which non-programmers shoot themselves in the foot.

I've come to really like the way environments work in R, as well.

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

#38
post #34

I don’t hate R as much as I hate universities insisting on mandatory use of R for all comp-stat courses. This to my mind verges on civil rights infringements. Bear in mind we aren’t talking about a private institution such as a company, where when you sign on as a dev for a paycheck, you do so voluntarily, knowing that the company uses X language and you won’t have a choice in the matter. In a public university, stud…

Well, the purported civil rights issues aside (which is a patently absurd point of argument on its face) – if you’re at the point where you’ve accumulated enough experience with both environments to form strong preferences for one over the other, that’s a decent sign that said course might just not be a good fit for you. I mean, professors and TAs are pretty overloaded already, and asking them to redesign course materials to accommodate additional environments is a tall order, especially for introductory courses.

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

#40
post #22
post #3

> There are subtle differences and some authorities prefer ...I am confused here. If you're testing for equality, R requires you to use == and not =. If you try to test for equality with =, it throws an error instead of treating it as an assignment. That's good. But who is trying to test for equality with <-?

I had the same confusion, can only assume the author is worried about this typo: if(a (which I assume is a less-than comparison, though I don't know R).

It is.
Post reply on HN