What R package do you use the most and why do you use it?
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.
BRugs: the power of R without the nasty UI of BUGS. The cost: slow as molasses.
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.
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).
Small nit: These are actually called packages rather than modules.
That said, some of the packages I frequently use are
- zoo and xts as container objects for irregular time series,
- lattice for visualisation,
- as well as a mix of packages from the
- Finance,
- Econometrics,
- TimeSeries,
- MachineLearning, .... Task Views for a variety of analyses.
- Rmpi and snow for parallel computing with R -- see the Task View on HighPerformanceComputing.
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
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.
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.
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.
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
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
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.
I think this one:
library(fortunes)
it's cool that R has this to help pass the time :D
I'm not experienced user, but these are usefull:
- ggplot2
- lattice
- xts
- zoo
- stringr
- reshape