I had a plan of learning R in the near future. Reading another question I found out about Clojure. Now I don't know what to do.

I think a big advantage of R for me is that some people in Economics use it, including one of my supervisors (though the other said: stay away from R!). One advantage of Clojure is that it is Lisp-based, and as I have started learning Emacs and I am keen on writing my own customisations, it would be helpful (yeah, I know Clojure and Elisp are different dialects of Lisp, but they are both Lisp and thus similar I would imagine).

I can't ask which one is better, because I know this is very personal, but could someone give me the advantages (or advantages) of Clojure x R, especially in practical terms? For example, which one should be easier to learn, which one is more flexible or more powerful, which one has more libraries, more support, more users, etc?

My intended use: The bulk of my estimation should be done using Matlab, so I am not looking for anything too deep in terms of statistical analysis, but rather a software to substitute Excel for the initial data manipulation and visualisation, summary statistics and charting, but also some basic statistical analysis or the initial attempts at my estimation.

  • 11
    $\begingroup$ If you would taste R, it is highly probable that you will resign from MATLAB (as in my case). $\endgroup$
    – user88
    Jul 19, 2010 at 21:33
  • $\begingroup$ IMO, this should be community wiki (language "versus" type questions are pretty subjective). $\endgroup$
    – Shane
    Jul 19, 2010 at 21:34
  • $\begingroup$ This is definitely a question concerning programming languages and should be asked on Stack Overflow. $\endgroup$
    – Sharpie
    Jul 19, 2010 at 21:35
  • $\begingroup$ I agree with Sharpie. @Vivi: you should change the question title to be "advantages and disadvantages for data munging" or something along that line so that it's more on-topic. $\endgroup$
    – Shane
    Jul 19, 2010 at 21:37
  • 5
    $\begingroup$ @Sharpie, @Shane IMO to this extent it is a question about tools, so it is acceptable. $\endgroup$
    – user88
    Jul 19, 2010 at 21:54

3 Answers 3


Let me start by saying that I love both languages: you can't go wrong with either, and they are certainly better than something like C++ or Java for doing data analysis.

For basic data analysis I would suggest R (especially with plyr). IMO, R is a little easier to learn than Clojure, although this isn't completely obvious since Clojure is based on Lisp and there are numerous fantastic Lisp resources available (such as SICP). There are less keywords in Clojure, but the libraries are much more difficult to install and work with. Also, keep in mind that R (or S) is largely derived from Scheme, so you would benefit from Lisp knowledge when using it.

In general:

The main advantage of R is the community on CRAN (over 2461 packages and counting). Nothing will compare with this in the near future, not even a commercial application like matlab.

Clojure has the big advantage of running on the JVM which means that it can use any Java based library immediately.

I would add that I gave a talk relating Clojure/Incanter to R a while ago, so you may find it of interest. In my experience around creating this, Clojure was generally slower than R for simple operations.


I have been a heavy R user for the past 6-7 years. As a language, it has several design limitations. Yet, for work in econometrics and in data analysis, I still wholeheartedly recommend it. It has a large number of packages that would be relevant to you for econometrics, time series, consumer choice modeling etc. and of course excellent visualization, good algebra and numerical libraries etc. I would not worry too much about data size limitations. Although R was not designed for "big data" (unlike, say, SAS) there are ways around it. The availability of packages is what makes the difference, really.

I've only read Clojure's language specs, and it's beautiful and clean. It addresses in a natural way issues of parallelization and scale. And if you have some basic java or OOP knowledge, you can benefit from the large number of high-quality java libraries.

The issue I have with Clojure is that is a recent one-man (R.Hickey) operation, therefore 1) very risky 2) very immature 3) with niche adoption. Great for enthusiasts, early adopters, CS/ML people who want to try new things. For a user who sees a language as a means to an end and who needs very robust code that can be shared code with others, established languages seem a safer choice. Just know who you are.

  • $\begingroup$ +1 Great answer. I had a similar debate a while back because I was intrigued by Incanter (and have done some Java coding). It was clear that R was the language to use to get statistical work done quickly while Clojure was the language to use to think more like a computer scientist. Obviously there is overlap but as you say "know who you are". $\endgroup$ Oct 21, 2011 at 13:13
  • 1
    $\begingroup$ SAS is so old that it originally ran on punched cards, hence its awkward and archaic syntax. Some amount of its "big data design" is simply dumb luck that it was originally designed to run on "mainframes" that had less memory than your phone, and which used punched cards to input data. I wouldn't say it's "designed" for Big Data, even though it happens to handle it well. $\endgroup$
    – Wayne
    Feb 8, 2014 at 19:26
  • $\begingroup$ I had similar concerns about Clojure in 2011 when I first heard of it. I don't now, in 2014. Clojure and its community are fairly mature, and it's surprisingly popular (after all, it's a non-OO, functional, Lisp). However, I don't believe Incanter will ever catch up to R in number of packages (usually, if you can think of it, it's already been done). There's a Clojure library Rincanter based on the JRI Java-R interface, but I'm not sure how easy this is to use. $\endgroup$
    – Mars
    Feb 8, 2014 at 19:34

Update (August 2014): as @gappy comments below, as of R version 3.0.0 the limits are higher and means R is capable of handling larger datasets.

Here's a data point: R has a "big data ceiling", useful to know if you plan on working with huge data sets.

I'm unsure whether the same limitations apply to Clojure/Incanter, whether it outperforms R or is actually worse. I imagine the JVM can probably handle large datasets, especially if you manage to harness the power of Clojure's lazy features.

  • 1
    $\begingroup$ R is also lazy evaluated. $\endgroup$
    – user88
    Jul 20, 2010 at 9:04
  • 3
    $\begingroup$ @mbq: Your comment is misleasing. R lazily evaluates variables in a function definition but "laziness" is not normal behavior. The function delayedAssign() exists to tell the interpreter to be lazy with a variable's assignment, but the interpreter will make the evaluation once any data structure points to that variable, whether it needs to be evaluated or not. Further, the commercial R company Revolution Analytics had to create an iterator object to support their marketing for using R in "big data" analysis. $\endgroup$ Oct 21, 2011 at 17:40
  • $\begingroup$ I think this answer should be updated. Since R 3.0.0, R does not have a limit of 2^31-1 element anymore. The limit is not 2^63-1 (I believe) and 2^31-1 on each dimension of an array. This makes it suited for large objects in memory. $\endgroup$
    – gappy
    Jul 31, 2014 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.