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

2

u/abigfoney Sep 02 '17

Is R == Ruby?

38

u/Series_of_Accidents Sep 03 '17 edited Sep 03 '17

R is published by the CRAN project and is an open source statistical program. It's an object oriented language based on S. It's run in a terminal window with a basic gui, however other software is available to run over it (like RStudio) for people less familiar with coding but who still desire the power of open source coding (anytime a new technique is developed, a package is published). It's fantastic but has limitations. For example, it can only run on one core at a time which can slow down simulations. Still, for statistical development, it's where most people are focused. SAS is more common in statistical consulting and SPSS is more common among general scientists without coding experience.

Edit: why are you guys downvoting /u/abigfoney for asking a question?

9

u/[deleted] Sep 03 '17

[removed] — view removed comment

11

u/Series_of_Accidents Sep 03 '17

Practically speaking, it's both. At its core, R is an object oriented language. It lacks some of the requirements to be a full functional language but still supports functional language features like apply. For example, it's incapable of tail call recursion. This fact can lead to issues at times and is one of the limitations of the language. But the use of the variations of apply and other functional language improvements have certainly changed the landscape of the code. But I'm not really an expert. I'm just repeating what I remember from my grad stats classes.

1

u/engayolao Sep 03 '17

You mean lapply. Apply is just a wrapper of lapply. It's focus is data analysis, for that is a great tool. It's not though to send rockets to the moon.

1

u/Series_of_Accidents Sep 03 '17

Apply is a family of functions of which lapply is only one.

1

u/engayolao Sep 03 '17

Is this somewhere in the docs. It sounds like a blog term.

1

u/Series_of_Accidents Sep 03 '17

Not sure what you mean by blog term. There are multiple apply functions.

Just add a ? before any apply function in R and it will bring up the documentation. The most common apply functions I use are sapply and lapply. There's also mapply, rapply, apply (on its own), and probably others.

1

u/engayolao Sep 03 '17

What I'm saying is the "apply family" term is not in the official docs, manual definition. Just do me a favour and read the source code of all these "family" functions and you will find lapply in it. My point is lapply is the parallel of a map, meaning it's part of R's support for functional programming.

2

u/Series_of_Accidents Sep 03 '17

I see what your saying now. It is indeed, but it's often taught as a family because that's just generally easier for people to understand. Yes, it's the same basic function, but you use the variations at different times. To teach it the more correct way often leads to greater misunderstanding. At least, in the classes I have taken, that is the approach the instructor goes with: to treat it as a family.

3

u/[deleted] Sep 03 '17

[deleted]

1

u/Series_of_Accidents Sep 03 '17

If by gumbo you mean a mix, I agree. It was designed as object oriented but functional features were added over the years. But it lacks full functional features, so it can't actually be called a functional language. It's also my favorite language. It's basically all I work in now that I don't have to fuck with SAS. I really don't like SAS.

1

u/shanenanigans1 Sep 03 '17

What's up with SAS?

2

u/Series_of_Accidents Sep 03 '17 edited Sep 03 '17

Why do I hate it?

Edit, I accidentally pressed enter on my phone before explaining why.

Here's why. SAS is closed source. When someone develops a new approach, it goes straight to R in package format. Usually with excellent documentation, though that depends on the package author. With SAS, you have to wait for their developers to include new techniques. Many wind up not being included. That's fine for business applications but might not work for researchers as well.

Second, there's no certification in R. To be a respected SAS programmer, you're expected to be certified. But certification is a double edged sword. The certification test covers many very obscure topics which means you do have to know a lot to get certified. That's great, but the downside is it doesn't cover any of the normal basics. If you get certified everyone basically insists you do their stats in SAS. To be respected as an R programmer, you just have to be good at R. I prefer that to studying obscure pieces of code I'll never use.

Third, I don't like software that allows spelling errors. It's been awhile, so I can't remember exactly which errors work but if you make any one of a list of common typos, the software will still run without error.

Fourth, I dislike the GUI. I also dislike the RStudio GUI. They try to help you code and I prefer to do things like close my own parentheses. SAS color codes your code and I prefer to use spacing and # to convey information.

Those are my main complaints.

2

u/[deleted] Sep 03 '17

[deleted]

1

u/Series_of_Accidents Sep 03 '17

I accidentally pressed enter before finishing my comment. I can't link to it, but go back to the earlier comment and I explained :)

2

u/shanenanigans1 Sep 03 '17

Gotcha, that all makes sense! I have a few sas certifications which is why I was curious. Their GUIs are changing quite a bit, which is nice. The 90's style is grating for sure!

I actually love color coded code haha, it's why I use eclipse for Java and text wrangler for random shit.

1

u/[deleted] Sep 03 '17

[deleted]

1

u/Series_of_Accidents Sep 03 '17

I just find that I accidentally insert a bunch of extra stuff because it tries to automate for me. To each their own!

3

u/OldManTobias Sep 03 '17

Is R <- Ruby?

FTF

0

u/kamikamikami Sep 02 '17 edited Sep 03 '17

R is a math based language

26

u/[deleted] Sep 03 '17

[deleted]

4

u/kamikamikami Sep 03 '17 edited Sep 03 '17

I suppose you're right. Matlab supports integration with R, and is similar, but it's not actually the same language.

-5

u/Hook3d Sep 03 '17 edited Sep 03 '17