Let’s Start What Is R?
Just to confuse you, R refers to two things. There is R, the programming language, and
R, the piece of software that you use to run programs written in R. Fortunately, most of
the time it should be clear from the context which R is being referred to.
R (the language) was created in the early 1990s by Ross Ihaka and Robert Gentleman,
then both working at the University of Auckland.
It is based upon the S language that was developed at Bell Laboratories in the 1970s, primarily by John Chambers. R (the software) is a GNU project, reflecting its status as important free and open source software.
Both the language and the software are now developed by a group of (currently) 20 people known as the R Core Team.
The fact that R’s history dates back to the 1970s is important, because it has evolved over
the decades, rather than having been designed from scratch (contrast this with, for
example, Microsoft’s .NET Framework, which has a much more “created”1 feel).
As with life-forms, the process of evolution has led to some quirks and inconsistencies. The upside of the more free-form nature of R (and the free license in particular) is that if
you don’t like how something in R is done, you can write a package to make it do things
the way that you want.
Many people have already done that, and the common question now is not “Can I do this in R?” but “Which of the three implementations should I use?” R is an interpreted language (sometimes called a scripting language), which means that your code doesn’t need to be compiled before you run it.
It is a high-level language in that you don’t have access to the inner workings of the computer you are running your code on; everything is pitched toward helping you analyze data.
R supports a mixture of programming paradigms. At its core, it is an imperative language
(you write a script that does one calculation after another), but it also supports object oriented programming (data and functions are combined inside classes) and functional
programming (functions are first-class objects; you treat them like any other variable,
and you can call them recursively).
This mix of programming styles means that R code can bear a lot of similarity to several other languages.
The curly braces mean that you can write imperative code that looks like C If you use reference classes, then you can write object-oriented code that looks a bit like C# or Java. The functional programming constructs are Lisp-inspired (the variable-scoping rules are taken from the Lisp dialect, Scheme), but there are fewer brackets.
If you like this post, don’t forget to share 🙂