28
votes
$\begingroup$

Duplicate thread: I just installed the latest version of R. What packages should I obtain?

What are the R packages you couldn't imagine your daily work with data? Please list both general and specific tools.

UPDATE: As for 24.10.10 ggplot2 seems to be the winer with 7 votes.

Other packages mentioned more than one are:

  • plyr - 4
  • RODBC, RMySQL - 4
  • sqldf - 3
  • lattice - 2
  • zoo - 2
  • Hmisc/rms - 2
  • Rcurl - 2
  • XML - 2

Thanks all for your answers!

$\endgroup$
8
  • 1
    $\begingroup$ Very subjective question: this question cannot be answered, and is not suitable for a QA site. $\endgroup$ Commented Jul 19, 2010 at 19:58
  • 3
    $\begingroup$ Should probably be community wiki; useful question here but doesn't have definitive answer. $\endgroup$
    – Shane
    Commented Jul 19, 2010 at 20:05
  • 2
    $\begingroup$ @Shane: good point. moved. @ Egon: subjective indeed. but if the answers come from knowledgeable people i don't mind dose of subjectivity. i've started learning R quite recently and have couple of dozens installed to explore, however i notice that there are tools that I use much more often irrespectively of the task at hand. $\endgroup$
    – user22
    Commented Jul 19, 2010 at 20:06
  • $\begingroup$ It would be interesting if StackExchange could support some method of linking community wiki posts across sites. Because I will bet this question has been asked on Stackoverflow and I also think that Statistical Analysis may attract some people that wouldn't usually visit SO. $\endgroup$
    – Sharpie
    Commented Jul 19, 2010 at 20:19
  • 2
    $\begingroup$ I disagree that it's for SO, especially considering the discussions on meta that supporting tools for statistical analysis (including software) is on-topic.... $\endgroup$ Commented Aug 14, 2010 at 12:25

37 Answers 37

1
vote
$\begingroup$

Please see link: TOP 100 R PACKAGES FOR 2013 (JAN-MAY) http://www.r-statistics.com/2013/06/top-100-r-packages-for-2013-jan-may/

$\endgroup$
23
votes
$\begingroup$

I use plyr and ggplot2 the most on a daily basis.

I also rely heavily on time series packages; most especially, the zoo package.

$\endgroup$
0
12
votes
$\begingroup$

In a narrow sense, R Core has a recommendation: the "recommended" packages.

Everything else depends on your data analysis tasks at hand, and I'd recommend the Task Views at CRAN.

$\endgroup$
1
  • 1
    $\begingroup$ +1 Package demands heavily depend on each individual and I think Task Views are the way to start anyone. $\endgroup$ Commented May 11, 2011 at 11:32
8
votes
$\begingroup$

I use the xtable package. The xtable package turns tables produced by R (in particular, the tables displaying the anova results) into LaTeX tables, to be included in an article.

$\endgroup$
8
votes
$\begingroup$

multicore is quite nice for tool for making faster scripts faster.
cacheSweave saves a lot of time when using Sweave.

$\endgroup$
0
8
votes
$\begingroup$

ggplot2 - hands down best visualization for R.

RMySQL/RSQLite/RODBC - for connecting to a databases

sqldf - manipulate data.frames with SQL queries

Hmisc/rms - packages from Frank Harrell containing convenient miscellaneous functions and nice functions for regression analyses.

GenABEL - nice package for genome-wide association studies

Rcmdr - a decent GUI for R if you need one.

Also check out CRANtastic - this link has a list of the most popular R packages. Many on the top of the list have already been ment

$\endgroup$
0
8
votes
$\begingroup$

data.table is my favorite now! Very look forward to the new version with the more wishlist implemented.

$\endgroup$
6
votes
$\begingroup$

Packages I often use are raster, sp, spatstat, vegan and splancs. I sometimes use ggplot2, tcltk and lattice.

$\endgroup$
6
votes
$\begingroup$

For me personally, I use the following three packages the most, all available from the awesome Omega Project for Statistical Computing (I do not claim to be an expert, but for my purposes they are very easy to use):

  • RCurl: It has lots of options which allows access to websites that the default functions in base R would have difficulty with I think it's fair to say. It is an R-interface to the libcurl library, which has the added benefit of a whole community outside of R developing it. Also available on CRAN.

  • XML: It is very forgiving of parsing malformed XML/HTML. It is an R-interface to the libxml2 library and again has the added benefit of a whole community outside of R developing it Also available on CRAN.

  • RJSONIO: It allows one to parse the text returned from a json call and organise it into a list structure for further analysis.The competitor to this package is rjson but this one has the advantage of being vectorised, readily extensible through S3/S4, fast and scalable to large data.
$\endgroup$
0
6
votes
$\begingroup$

Sweave lets you embed R code in a LaTeX document. The results of executing the code, and optionally the source code, become part of the final document.

So instead of, for example, pasting an image produced by R into a LaTeX file, you can paste the R code into the file and keep everything in one place.

$\endgroup$
1
  • 4
    $\begingroup$ Just a hint for all those who want to get started on reproducible research with R. I would advice you to have a look at the newish package knitr instead of Sweave. It's basically Sweave on steroids. It is as easy, if not easier, to learn and far more flexible. $\endgroup$ Commented Feb 18, 2013 at 21:05
6
votes
$\begingroup$

I imagine graphics and data manipulation are two things that are useful no matter what you are doing. Thus, I'd recommend:

  • ggplot2 (great graphics)
  • lattice (great graphics)
  • plyr (useful for data manipulation)
  • Hmisc (good for descriptive statistics and much more)
$\endgroup$
0
4
votes
$\begingroup$

zoo and xts are a must in my work!

$\endgroup$
4
votes
$\begingroup$

I find lattice along with the companion book "Lattice: Multivariate Data Visualization with R" by Deepayan Sarkar invaluable.

$\endgroup$
4
votes
$\begingroup$

You can get user reviews of packages on crantastic

$\endgroup$
4
votes
$\begingroup$

I would suggest using some of the packages provided by revolution R. In particular, I quite like the:

  • multicore package for parallel computing using shared memory processors
  • there optimized packages for matrices
$\endgroup$
4
votes
$\begingroup$

If you are doing any kind of predictive modeling, caret is a godsend. Especially combined with the multicore package, some pretty amazing things are possible.

$\endgroup$
4
votes
$\begingroup$

Day-to-day the most useful package must be "foreign" which has functions for reading and writing data for other statistical packages e.g. Stata, SPSS, Minitab, SAS, etc. Working in a field where R is not that commonplace means that this is a very important package.

$\endgroup$
3
votes
$\begingroup$

I use

car, doBy, Epi, ggplot2, gregmisc (gdata, gmodels, gplots, gtools), Hmisc, plyr, RCurl, RDCOMClient, reshape, RODBC, TeachingDemos, XML.

a lot.

$\endgroup$
3
votes
$\begingroup$

This is definitely a question that doesn't have "an answer". It is completely dependent on what you want to do. That aside, I'll share the packages that I install as a standard with an R update...

install.packages(c("car","gregmisc","xtable","Design","Hmisc","psych",
                        "CCA", "fda", "zoo", "fields",
                      "catspec","sem","multilevel","Deducer","RQDA"))

and leave it to you to investigate those packages and see if they are valuable to you.

$\endgroup$
3
votes
$\begingroup$

You can also take a look at Task views on CRAN and see if something suit your needs. I agree with @Jeromy for these must-have packages (for data manipulation and plotting).

$\endgroup$
3
votes
$\begingroup$

If you are working with Latex, I recommend TikZ Device for outputting nice, Latex-formatted (like PSTricks) graphics. The output you get is text-based Latex code, which can be embedded with include(filename) into any figure environment.

Pros:

  • Same font in graphics as in your text
  • Professional look

Cons:

  • Takes longer to compile than PNG or PDF
  • for very complex R graphics, there are could be some display errors

https://github.com/Sharpie/RTikZDevice - Project, Packages available from CRAN and R-Forge

$\endgroup$
2
  • 2
    $\begingroup$ No disrespect, but that strikes me as entirely subjective. I have used latex for since the late 80s and R since the 90s yet I see no good reason to move away from embedding eps files. Everybody's mileage will differ here, and Thomas should maybe look at Task Views for particular problem domains. $\endgroup$ Commented Aug 14, 2010 at 13:04
  • $\begingroup$ @Dirk: Good typography should not draw attention to its self and getting different text from LaTeX and R graphics is very visible (EPS output on the left, Sweave source code). Admittingly the example is a bit biased as no effort is made to customize the font used by eps. The point is that tikz should match the LaTeX document font, font size, letterspacing, kerning, ligaturing, etc. by default. If it doesn't, I consider it a bug. $\endgroup$
    – Sharpie
    Commented May 10, 2011 at 21:54
3
votes
$\begingroup$

I use lattice, ggplot2, lubridate, reshape, boot, e1071, car, forecast, and zoo a lot.

$\endgroup$
3
votes
$\begingroup$

I could not live without:

  • lattice for graphics
  • xlsx or XLConnect for reading Excel files
  • rtf to create reports in rtf format (I would prefer Sword or R2wd but I cannot install statconn at work; I will surely try odfWeave soon.)
  • nlme and lme4 for mixed models
  • ff for working with large arrays
$\endgroup$
3
votes
$\begingroup$

I can recommend the new shiny based packages to everyone, it makes data visualisation and inspection interactive and thus easier than writing code in R espacially in the beginning.

A good example would be ggplotgui

$\endgroup$
2
votes
$\begingroup$

RODBC for accessing data from databases, sqldf for performing simple SQL queries on dataframes (although I am forcing myself to use native R commands), and ggplot2 and plyr

$\endgroup$
2
votes
$\begingroup$

I work with both R and MATLAB and I use R.matlab a lot to transfer data between the two.

$\endgroup$
2
votes
$\begingroup$

We mostly use:

  • ggplot - for charts
  • stats
  • e1071 - for SVMs
$\endgroup$
1
  • $\begingroup$ You may also want to check out kernlab and caret for SVMs. They're interesting (thought not necessarily better) alternatives. $\endgroup$
    – Zach
    Commented May 8, 2011 at 2:27
2
votes
$\begingroup$

lattice, car, MASS, foreign, party.

$\endgroup$
2
votes
$\begingroup$

For me I am using kernlab for Kernel-based Machine Learning Lab and e1071 for SVM and ggplot2 for graphics

$\endgroup$
2
votes
$\begingroup$

I use ggplot2, vegan and reshape quite often.

$\endgroup$