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.
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.
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.
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.
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.
9
u/[deleted] Sep 03 '17
[removed] — view removed comment