Setting up Textmate to use R

[This article was first published on World of R-Craft, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.



After becoming frustrated using the StatET plugin for Eclipse on my Mac (sometimes the R console would start and sometimes not), I decided to use Textmate instead. Textmate allows you to install extra bundles which are plug-ins to add some new functionality to TextMate. There are two bundles relevant for R developers:
– R bundle (here)
– Latex bundle (here)
– Sweave bundle (here)

If you are running Leopard (Mac OS 10.5), the subversion client should be installed (otherwise, do so – you can find more info about this on the TextMate help pages).

To install the two bundles, invoke the following terminal spells:
mkdir -p /Library/Application\ Support/TextMate/Bundles cd /Library/Application\ Support/TextMate/Bundles svn co http://svn.textmate.org/trunk/Bundles/R.tmbundle svn co http://svn.textmate.org/trunk/Bundles/Latex.tmbundle svn co http://svn.textmate.org/trunk/Bundles/SWeave.tmbundle

Start up TextMate and now you have support for R and Sweave in TextMate (this assumes that you already have installed a copy of Latex – get the MacTeX-2008 distribution here).

Chances are that if you want to “Sweave, Typeset and View” R will choke because it does not find the necessary Sweave LaTeX style file (sweave.sty) file. If this is the case, just put a copy of sweave.sty into your working directory and everything will work wonderfully (yes, I know that this should be fixable by setting up the right search path somewhere, so if you have run into this problem and fixed it better than me, please send some enlightening commentaries!).

To leave a comment for the author, please follow the link and comment on their blog: World of R-Craft.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)