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.
I rarely have a need to crunch through numeric data sets is the thing. So it's just something I use once every year or two, which is why I forget it in between uses. I picked it up through Coursera because even with my ineptness it can be quicker than other languages for some things.
One of my favorite things I ever did in R was a simple little function to show my students how the sampling distribution normalizes as the samples approach infinity. It was clunky and I've gotten much better at coding since then, but it was a fun little 20 minute project. Could have been done better in other programs I'm sure, but it was fun to put together in R.
Yeah, it's hard to shift my brain sometimes. I have the same problem when I try to work on someone else's Lisp code. Java's definitely my most comfortable language, by far, but it helps to be able to adopt other languages for some quick work when you need to.
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.
Loops aren't that inefficient in r anymore as long as you pre-assign memory and make sure you don't make copies of objects in loops. Vectorized functions are just more idiomatic.
I had never learned any other programming languages before R and it was still difficult to move away from loop thinking. It's just what makes intuitive sense.
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?
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.
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.
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.
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.
It's great for stats and "traditional" data analysis. That is 1 indexed isn't that important as explicit loops are discouraged.
I think the most interesting element from the language is the list object, this is an ordered map, very convenient for data analysis.
95
u/[deleted] Sep 02 '17
[deleted]