R vs Matlab

It has now been almost half a year since I switched from Matlab to open source software and I’ve been amazed at how easy the transition has been. I had planned to replace Matlab with Python, Julia, and R but I have found that R and Julia have been sufficient for my requirements. Maxima is also more than adequate to replace Mathematica. I have become particularly attached to R especially after I started to use R Studio as the interface. I had only used R before as just a statistics tool but it really is a complete programming platform like Matlab. It has very nice graphics capabilities and I find the language very nice to program in. I really like its use of lists where I can pile sets of any type and any size into one object. I also like how R Studio can save your work into Projects, which keeps the whole environment and history in one place. I can then switch between multiple projects and everything comes back. The only thing I miss from Matlab is the command completion history feature, where I could easily find a previous command by just typing the first few letters. Also, I haven’t quite figured out how to output R data into a text file seamlessly yet. I seem to always get extraneous row or column information. I use Julia when I want to write a code that needs to loop fast but for everything else I’ve been reaching for R.

8 thoughts on “R vs Matlab

  1. Glad to see you’re a convert to R, Carson! I use ESS and R-mode inside Emacs (I’ve been using Emacs for 34 years), and it does have command completion.


  2. Emacs/ESS does not have have that explicitly, but since it is an editor, you can just do a reverse search (^R) and the editor will take you to that earlier command. You can then either hit ^J to run it again, or copy and paste it if you want to edit it first. Alternatively, Ctrl-UpArrow cycles you through previous commands in order.


  3. I may have sold ESS short there! A Google search found ( http://ess.r-project.org/Manual/ess.html#History-expansion ) that typing a string followed by C-c M-r (Ctrl-c then Esc followed by “r”) will bring up the most recent command that started with that string. Also just plain M-r will prompt you for a regular expression to search the command history (the “shell history ring”).


  4. In many ways I love R—very powerful, awesome community and huge set of packages—but as a programming language it really has some terrible deficiencies. Still would prefer it to e.g. Matlab overall for various reasons.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s