tags:

views:

892

answers:

18

What R package do you use the most and why do you use it?

+2  A: 

It's been a while since I needed to use R, but Rcmdr.

Thomas Owens
+12  A: 

I use ggplot2 for graphs. As far as graphing data goes, it wins.

Vinay
+2  A: 

I'm a bioinformatician, so I use Bioconductor.

Konrad Rudolph
Not to nitpick, but that ain't a package....
Dirk Eddelbuettel
+3  A: 

The line of code that begins practically all of my R code is

library(lattice)

Lattice is a graphics package much, much superior to R's built-in graphics package. I can't imagine doing any serious kind of work without it. The author of the package has recently published a book about it and the book's figures and code can be browsed for free.

lindelof
Me as well. #rstats!
Vince
+3  A: 

nlme: non-linear mixed effects

Gregg Lind
A: 

BRugs: the power of R without the nasty UI of BUGS. The cost: slow as molasses.

Gregg Lind
+1  A: 

I think a list of your Top 10 would be better. First, if you use a non-base-graphics package (ggplot2, lattice), that would have to be your "most used". Second, one of the beauties of R is how many packages there are, so choosing one would be neigh impossible.

My Top Ten -- not in any particular order -- would be:

lattice, ggplot2, MASS, e1071, mixtools, klaR, cluster, MASS, HMisc, and akima.

"MASS" mentioned two times...
Peter Mortensen
+6  A: 

Crantastic provides ratings on R packages, and might be worth browsing if you're looking for which packages are considered valuable.

R Task Views at CRAN classify R packages into broad categories such as Graphics, Time Series, and Finance.

My peronal favorite packages are RMySQL (read from and write to MySQL), ggplot2 and lattice (both graphics).

dataspora
+5  A: 

Small nit: These are actually called packages rather than modules.

That said, some of the packages I frequently use are

Dirk Eddelbuettel
I've edited the question to reflect the proper naming convention.
David Locke
Excellent, thanks!
Dirk Eddelbuettel
+4  A: 

A few of my favourites:

  • forecast (which I authored) - provides loads of functions for doing forecasting
  • tseries - some additional time series tools that I use a lot
  • foreign - for importing data from other statistics software
  • lattice - great graphics
  • Hmisc - has a neat function latex() for generating LaTeX tables.
  • mgcv - for its gam() function for nonparametric regression
  • RWinEdt - my favourite Windows text editor for R code
  • car - a few additional regression functions that I find useful
Rob Hyndman
Prof Hyndman, glad to see you on Stack Overflow! The R community here will benefit from your experiences, I am sure.
JD Long
+3  A: 

ggplot2 for graphics. It isn't yet perfect, but it is great.

Sweave for mixing R and LaTeX - I have a number of surveys for which I produce standardized reports. My predecessor spent 7-8 weeks a year copying results from Excel into Word; I spend about a week, mostly cleaning data, and get lovely LaTeX PDFs. It also substantially cuts down on the kind of errors I cause when I spend a month copy/pasting for eight hours a day.

Er... it cut down on errors once I debugged the program, anyway.

I also use RODBC to query a Banner database to match personal info with survey results. It is smoooooth.

Matt Parker
+3  A: 

Technically, base ;)

When I use R, I tend to mostly be using Bioconductor tools, which means that Biobase package is almost always loaded.

I also tend to use RdbiPgSQL a lot, although have been meaning to check out RPostgreSQL.

geoffjentry
A: 

Being a bioinformatician, the tools from the Bioconductor Project are mandatory for my work and I spend most of my time using them. I love Sweave! This nice implementation of the Literate Programming paradigm allows to automate my workflow and produce beautiful reports.

Paolo
+1  A: 

Two that haven't been mentioned much here but are extremely useful as they combine (and provide a common interface to) many other modeling packages:

  • zelig
  • caret
Shane
A: 

My research is related to the social and behavioural sciences. I do 90% of what I need with base R. However, I also use the following:

  • psych: many good functions related to common analyses in psychology
  • ggplot2: great plots
  • lattice: great plots
  • car: particularly the recode function
  • Hmisc: regression-related and assorted tools
  • sna: basic social network analysis (for other SNA packages I use, see: http://jeromyanglim.blogspot.com/2009/08/social-network-analysis-resources-for-r.html)
  • foreign: a lot of my colleagues use SPSS
  • lme4: linear and nonlinear multilevel modelling
  • strucchange: good for detecting structural changes in time series
  • sem and OpenMX: two Structural Equation Modelling options

Drew Conway also had a good list for social scientists: http://www.drewconway.com/zia/?p=1614

Jeromy Anglim
A: 

Well, it might be a little controversial since it is non-free, and you can't get it through CRAN, but library(doSMP). You can use it in combination with the foreach package to fairly easily split long computations over several cores. In my case, a calculation that used to take 31 hours took 19 hours after I rewrote some parts to use doSMP and foreach -- and thats on a machine with only two cores. There is a similar package for Linux called doMC. I really hope the people behind these packages, Revolution R, consider making them available on CRAN so that more people become aware of them and have a chance to use them.

whyenot
+4  A: 

I think this one:

library(fortunes)

it's cool that R has this to help pass the time :D

Christine Forrester
A: 

I'm not experienced user, but these are usefull:

  • ggplot2
  • lattice
  • xts
  • zoo
  • stringr
  • reshape
tovare