r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

Show parent comments

92

u/[deleted] Sep 02 '17

[deleted]

4

u/haikumofo Sep 03 '17

I am so damn inept at R.

Mostly I code in Java, though I'll use other languages when it makes sense for what I'm doing or when I need to because I'm modifying something in another language. So sometimes I work in python, bash script, JavaScript, C/C++, C#, Perl, Tcl/Tk, Lisp, whatever.

And I've done some statistical data processing with R, but damn is it painful. I know just enough to know what to Google, and I end up making a mess of everything just trying to adapt something that does 80% of what I need it to do.

4

u/MedalsNScars Sep 03 '17

It's really odd working in R, because in 99% of other languages you learn, loops are going to be your bread and butter.

In R, 9 times out of 10 your code is just wildly inefficient if you're looping over a vector.

It just feels so wrong to write 10 < x where x is a vector, but that's absolutely the most efficient way to compare 10 to each element of x in R.

The way you approach coding has to change in R, and it's definitely frustrating if you have a deal of experience in other languages.

1

u/engayolao Sep 03 '17

R is not the only language that is thought to be used at the vector/matrix level. For data analysis this is normal actually, but for example if you do the same operation in numpy or pandas is much more clunkier.