Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tools Commonly used to Program in R

Tags:

r

ide

I apologize if this has already been asked a different way but I couldn't find anything getting at what I wanted.

I am really getting into R from other packages (SPSS). As I learn about what truly can be done, I realize that there are additional "tools" that I need. This gets me to my question.

What setup do you have for developing R code? I can't see myself actually developing r packages anywhere in the near future, but I do see myself wanting to manage my r projects effeciently, as well as create reports and presentations in LaTeX.

For context, I develop my R code in Eclipse for Windows, but I have had a real hard time successfully setting up Latex/Sweave and Github plugins.

Lastly, do you develop code using Windows or something else?

Many thanks in advance for any insight you can lend.

like image 692
Btibert3 Avatar asked Sep 29 '10 03:09

Btibert3


2 Answers

Emacs has everything I commonly need:

  • ESS (for R),
  • AucTeX (for Latex),
  • similarly rich 'modes' for other languages I use (C++, make, shell, ...),
  • plus a lot of other modes you get quite used to as e.g. dired for directory/file browsing or org-mode as planner/to-do list,
  • the SVN integration is very good too
  • and there are probably a number of tools within Emacs I am now forgetting.

Works in text mode as well as graphical mode, and works essentially the same (incl ESS and AucTeX) on several operating systems (Linux mostly and Windows when I must). On Debian/Ubuntu all this is prepackaged and tends to work out of the box as well. For both Windows and OS X, Vincent Goulet has package very handy bundles, see here.

The 'daemon mode' is outstanding too -- I keep the same main Emacs session running and just connect and re-connect to it even when accessing the machine (via ssh or directly) from different computers.

Also see the EmacsWiki for more tips around Emacs.

Back to Emacs and R in particular. The R FAQ says it pretty well:

  • 6.1 Is there Emacs support for R?
  • 6.2 Should I run R from within Emacs?

and I like the affirmative and resounding answer to the second question: "Yes, definitely". I fully concur.

like image 166
Dirk Eddelbuettel Avatar answered Oct 24 '22 07:10

Dirk Eddelbuettel


I'll second the suggestion that Emacs compliments R nicely, but let me share what the "killer feature" is for me.

Using Org-mode with Org-babel, I can write whole reports with inline graphs produced from R in raster and vector format which compiles seamlessly into a PDF report via latex. I can also view the graphs while editing, similar to a WYSIWYG editor.

I just wrapped up a major report with over 70 inline graphs with little effort, no editing external files, no issues maintaining naming between figures in my report and external files, or forgetting to recompile the latest version of a figure. Org & Babel does it all.

Org-mode: http://orgmode.org/

Org-Babel: http://orgmode.org/worg/org-contrib/babel/index.php

Example of inline R with Babel and PDF output, see the first example in multiple formats: http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.php

Enjoy!

like image 39
Demosthenex Avatar answered Oct 24 '22 07:10

Demosthenex