Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to search for R packages? [closed]

Tags:

search

r

Related question

how to search for r materials

Part of the reason why the R community has been attracted to a tag based service like StackOverflow, I think, is that information on R is fundamentally difficult to find online. Services like RSeek have made this slightly less painful, however, I often find the search results scattered.

Specifically, I am often curious if R packages exist to meet a specific need I am facing. RSeek is useful for finding package documentation, but not for discovering new packages---and the R package manager is even less useful. As such, what are some best practices for searching for packages? That is, when I realize I have a need that my current set of R packages will not meet, and before creating the functionality myself I would like to search for a package that will meet the need. What is the best way to proceed?

like image 263
DrewConway Avatar asked Sep 08 '09 17:09

DrewConway


People also ask

How do I get a list of packages in R?

To see what packages are installed, use the installed. packages() command. This will return a matrix with a row for each package that has been installed.

Where are my R packages located?

R packages are a collection of R functions, complied code and sample data. They are stored under a directory called "library" in the R environment.

How do I search in R?

R doesn't have a built-in binary search function, but writing such a function isn't too difficult. The first statement creates an integer vector with five values. The second statement sets up a target value for which to search. The third statement uses the built-in %in% operator to search for the target.

How many R packages are there on CRAN?

R is the lingua franca of Data Science that comprises of a massive repository of packages. These packages appeal to various fields that make use of R for their data purposes. There are 10,000 packages in CRAN, making it an ocean of quintessential statistical functions.


1 Answers

First, use help.search() or the shorthand ??. This will search the help files of installed packages. I often find I have a package installed that does what I want; I just haven't used it before.

Next, use the findFn function in the sos package. This function searches the help pages of packages covered by the RSiteSearch archives (which includes all packages on CRAN). These are ordered based on a relevance score, so the top few packages on the list are probably the most useful.

To look even further afield, use RSiteSearch() which will send your search to R site search. As well as CRAN packages, this covers the R-help mailing list archives, help pages, vignettes and task views.

Still no luck? Try Rseek.org. It covers more sites.

Finally, if all else fails, ask here on StackOverflow or send your question to the R-help mailing list.

like image 172
Rob Hyndman Avatar answered Oct 17 '22 08:10

Rob Hyndman