http://stackoverflow.com/questions 11k: Matlab can eat up my software budget. R has not managed to do this, yet. To correct some other statements: it is not correct that one can reuse all Matlab code in Octave or FreeMat. There are some classes of functions that are not well implemented at all in the other versions. I have large blocks of code that I have found it better to implement anew in environments that have approximately similar functionality for just these classes of functions. Of the functionality that Matlab has that Octave does not, I have found surrogates in R, Python, and, to some extent, Java and C. Reimplementing libraries is harder than basic code. Pay attention to libraries... 42k: Technically, anything that can be done in one language can be done in any language (from a "what can it compute" point of view). It's just a matter of ease-of-use and ease-of-learning 6.5k What are your performance requirements (disk, memory, network, filesizes)? Are you touching a database? Are you operating totally offline or ar there any response-time or rate requirements? Do you care about scalability? Crash recovery? etc etc 2K R has a large package repository called CRAN that provides a wealth of additional features (though I agree with your general point). Ex: a PDE solver: 85K: MATLAB also has something analogous to CRAN: a sizable File Exchange (mathworks.com/matlabcentral/fileexchange) with over 10,000 user-submitted functions and toolboxes that are freely available. 32K R is an environment for statistical data analysis and graphics. MATLAB's origins are in numerical computation. The basic language implementations have many features in common if you use them for for data manipulation (e.g., matrix/vector operations). R has statistical functionality hard to find elsewhere (>2000 Packages on CRAN), and lots of statisticians use it. On the other hand, MATLAB has lots of (expensive) toolboxes for engineering applications like - image processing/image acquisition,
- filter design,
- fuzzy logic/fuzzy control,
- partial differential equations,
- etc.
8k:
25k Short answer: no, of course not. While any set of mathematical software packages will have their overlaps, they will always have biases towards certain problem domains. These biases figure strongly in whether or not you want to use one of these packages. An example of what MATLAB can do that R cannot is interface to real-time hardware for signal processing/acquisition and control. A Simulink model in MATLAB can be configured both to run in simulation on your machine before compiling the code to execute on a real system taking measured data as input and calculating appropriate outputs (what was before a simulation of a control system is now a fully functioning one). With the appropriate hardware board in your machine, you can run real-time control systems through a PC. R, by contrast, seems firmly set in the role of statistics, where I'm sure it out-performs what MATLAB can do. Similarly, Mathematica is better than MATLAB at symbolic maths; Python is better than MATLAB at general programming; gnuplot is better than all of them at actually creating graphs (er, I assume); and so on. 20K:R is actually known to be very good for creating graphs. They look very good too. Actually, the very first reason for me to look into R was I was jealous of some of the nice graphs that my colleagues had made, using R. So I switched from gnuplot and have never looked back. 4K:Since the answer is specific to the diffset of MATLAB and R capabilities, I will mention a very important one: MATLAB includes a JVM and has flawless and robust interoperability with Java. All of Java's vast universe of libraries is accessible to the MATLAB user. The MATLAB IDE can be almost be used as a poor man's Eclipse. In comparison, rJava is very immature, despite the very valuable effort of 489: Support for interactive graphics is much better in matlab than in R. I hate matlab as a language, but I get jealous when I see how its users can explore data with mouse operations, while I'm busy repeating commands with new values for 55k: Yes. I used MATLAB for years but switched primarily to R in the last 3 years. At this point, they have much more in common than not. It partially depends on your field and use-case. And as Spencer Graves said previously, it also depends on which "church you happen to frequent". It's best if you look at theMATLAB toolkit vs. CRAN for a specific task before you decide. A similar question asked on R-Help a few years ago and again more recently. David Hiebeler (at the University of Maine) maintains an extensive Here are some of the things that I've observed in the past, none of which should be deal-breakers. - Generally, MATLAB has a better programming environment (e.g. better documentation, better debuggers, better object browser) and is "easier" to use (you can use MATLAB without doing any programming if you want). Simulink allows you to visually program by connecting blocks in graphs. REvolution R is addressing some of these differences by providing a better IDE with improved debugging, but it's still a step behind.
- MATLAB is a little faster with the normal configuration (see this benchmark for an example), although there are things that can be done to improve R performance if that becomes an issue.
- Since it's commercial, it also arguably has more "products" (in the sense of integrated add-ons) and support (but you pay for it). See the product list. For instance, it has things like the MATLAB compiler which creates executable MATLAB programs that can be deployed.
- So far as packages/toolkits are concerned, MATLAB has much more support for the physical sciences while R is stronger for statistics, which is not to say that the other can't perform these tasks. And they can both be easily extended.
So, if ease-of-use isn't a primary concern (and there's no other business reason to avoid using an open-source tool), then I think that there's a real case to be made for using R. It has a very strong community around it (the R mailing lists are amazing), is rapidly developing (see CRAN), and it's
59: With the sqldf package, R is capable of not only statistics, but serious data mining as well - assuming there is enough RAM on your machine. And with the RServe package R becomes a regular TCP/IP server; so you can call R out of java (or any other language if you have the api). There is also a package in R to call java out or R. 24K: There's a nice matlab/R reference that shows how to perform equivalent tasks in each here:math.umaine.edu/~hiebeler/comp/matlabR.html 51K: "[MATLAB] also arguably has more products and support". I disagree with this. CRAN and Bioconductor (for R) are much more comprehensive than MATLAB + the toolboxes + the File Exchange. Also, the R-Help mailing list is usually as effective as paid support, in my experience. I agree that the MATLAB compiler is a great feature that isn't replicated in R. "R graphics has a 1960s feel" - that may have been true years ago. These days, 5K: A lot of times R functions are better documented than those in Matlab. I find that the quality of Matlab documentation varies a lot from function to function and between (commercial) toolboxes. I agree that Matlab IDE is somewhat more beginner friendly, but it is not 1K RStudio is a nice new R IDE |