Live data from Hacker News

A newcomer’s (angry) guide to R

arrgh.tim-smith.us

151–160 of 232 posts

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

#151
post #83

Earlier quoted context omitted.

Tidy features (like pipes) are detrimental to performance. The best things R has going for it are data.table, ggplot, stringr, RMarkdown, RStudio, and the massive, unmatched breadth and depth of special-purpose statistics libraries. Combined, this is a formidable and highly performant toolset for data analytics workflows, and I can say with some certainty that even though “base Python” might look prettier than “base…

> Tidy features (like pipes) are detrimental to performance. But they are some absolutely amazing features to use. After helping my wife learn R, and learning about all the dypler features, going back to other languages sucked. C#'s LINQ is about as close as I can get to dypler like features in a main stream language. Of course R's data tables and data frames are what enable dypler to do its magic, but wow what magic…

I think your autocorrect mangled up your `dplyer`s :)

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

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

I am always amazed when I hear that people use Python in any type of production pipeline.

^^ THIS. And yet certain organisations I know have upwards of 40M lines of it. Run. Run. Run FASTER.

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

#153

Earlier quoted context omitted.

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 syntax is strange and reflects an earlier evolution of the ideas that went into the tidyverse. Because it's the "grammar of graphic" see the link below. https://ramnathv.github.io/pycon2014-r/visualize/ggplot2.htm... If you don't like that syntax use another library. But ggplot2 how you code graphic like that is amazing for me and many other people. I've tried SAS and Matlab and ggplot2 is the best.

Personally I prefer lattice which is syntactically very similar to ggplot but produces graphics which are more aesthetically pleasant IMO.

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

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

I am always amazed when I hear that people use Python in any type of production pipeline.

Could you please elaborate on that?

My company has tons of python code producing reports with reportlab, making UIs with PyQt5, as well as a multitude of small scripts to interact with MySQL.

We’ve been nothing but happy with Python in the years of using it.

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

#155

This is a stupendous example of someone going overboard on their criticisms in order to grandstand. R may not be the most "beautiful" language in a general perspective, but it certainly is more beautiful than Python when it comes to actual data analysis. There is nothing in R that is as ugly as even the best implemented pandas, numpy, and matplotlib code. All of the options in Python, which is generally pointed to as…

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 sometimes I get DIY pages as a result.

I love pretty much every other design decision about Rust, but it's the one "hard" to Google language in my experience.

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

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

Good point about the package management, but I disagree with your argument. Non-Computer Scientists seem to have a much easier time with Python than R, anecdotally.

I think the reason is that R is not just a badly designed language, but in particular its design is inconsistent. That’s as confusing to newcomers as it is to people who care about PL design.

I used R for almost a decade. Last year I switched to Python and Jupyter, never looked back. Can’t recommend the switch highly enough. R has great stats packages, but struggling with the language is just not worth it.

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

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

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'll just leave this here... https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...

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

#158
post #71

Earlier quoted context omitted.

And there is litterally no equivalent to dplyr and ggplot2 in Python. Those alone can make a huge difference in how many lines you need to write to do something.

ggplot2 has plotnine ( http://plotnine.readthedocs.io ) which has a nearly identical API. I've found though it's not perfect, you can get closer to dplyr with JS-style method chaining on Pandas.

I've recently used plotnine, and it's been a relatively good experience, but Pandas is absolute garbage compared to the tidyverse, API-wise.

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

#159

Earlier quoted context omitted.

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.

Are you sure about "most RDBMSs"? With the exception of SQLite and older versions of MySQL, all the databases that I've used are strict and fail the query immediately on error, will generally prevent silently dropping or truncating data, etc. I'm one of the original authors of Presto, a distributed SQL engine for analytics on big data. From the beginning, we've been careful to follow the SQL standard and do everythin…

What I mean is that if you run in batch mode they’ll fail a query and happily run the next. Generally, depending on the client, you need to handle begin/commit/rollback blocks yourself. This is pretty common in scripting languages. Unlike, for example Java, where an unhandled error will terminate the process.

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

#160
post #68

Earlier quoted context omitted.

From your experience what makes data.table so useful?

Answering questions in a rapid, interactive way (, while using C to be efficient enough that one can run it on millions of rows): # Given a dataset that looks like this… > head(dt, 3) mpg cyl disp hp drat wt qsec vs am gear carb name 1: 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 2: 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 Mazda RX4 Wag 3: 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 Datsun 710 # What's the mean hp an…

What a lot of people don't get is that this kind of code is what R is optimized for, not general purpose programming (even though it can totally do it). While I don't use R myself, I did work on R tooling, and saw plenty of real world scripts - and most of them looked like what you posted, just with a lot more lines, and (if you're lucky) comments - but very little structure.

I still think R has an atrocious design as a programming language (although it also has its beautiful side - like when you discover that literally everything in the language is a function call, even all the control structures and function definitions!). It can be optimized for this sort of thing, while still having a more regular syntax and fewer gotchas. The problem is that in its niche, it's already "good enough", and it is entrenched through libraries and existing code - so any contender can't just be better, it has to be much better.

Post reply on HN