# I just installed the latest version of R. What packages should I obtain?

Duplicate thread: What R packages do you find most useful in your daily work?

Are there any R packages that are just plain good to have, regardless of the type of work you are doing? If so, what are these packages? If not, what packages do you find the most useful?

• Debating making this Community Wiki - I really want to see what the first couple of answers are, first, though. If someone can provide a list of "must have" R packages, I'll probably accept that. If it begins to turn into a list of suggestions (or someone has an otherwise good reason), I'll CW this thing up. – Thomas Owens Aug 14 '10 at 1:40
• I would say that this should be community wiki. – Shane Aug 14 '10 at 2:13
• Possible duplicate: stats.stackexchange.com/questions/73/… – Shane Aug 14 '10 at 2:14
• I agree it should be CW as the answer depends entirely on what you want to do. I load a lot of forecasting and time series packages, but others may not need them at all. – Rob Hyndman Aug 14 '10 at 5:13
• I would close as a duplicate; also this question is within the scope of the site. – russellpierce Aug 17 '10 at 7:13

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.

• +1 Package demands heavily depend on each individual and I think Task Views are the way to start anyone. – Roman Luštrik May 11 '11 at 11:32

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)

You can get user reviews of packages on crantastic

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

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.

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).

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

• 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. – Dirk Eddelbuettel Aug 14 '10 at 13:04
• @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. – Sharpie May 10 '11 at 21:54

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

Jeromy mentioned my first pick: Lattice.

I also have found the doBy package and its summaryBy function to be insanely useful. They extend aggregate with a formula syntax that lets you aggregate multiple functions simultaneously in non-trivial ways. Great if you want, say, mean, std. dev., and length.

Some packages are very useful in R.

I will just recommand kernlab for Kernel-based Machine Learning Lab and e1071 for SVM and ggplot2 for graphics