0

I wonder if there's aptitude (one of Debian's package manager) like functionality in R to find available packages from repos? For finding and installing packages via find.package(x) and install.packages(x) one should know the exact name of the package. Is there a similar command to aptitude search x or apt-cache search x to make a search and then pick the exact name of the package from the returned list?

oakenshield1
  • 851
  • 1
  • 11
  • 26
  • 1
    The sos package, perhaps? – A5C1D2H2I1M1N2O1R2T1 May 02 '14 at 14:29
  • 1
    Two ideas; (1) `library("sos"); ?findFn`; (2) `a1 <- available.packages(); grep("foo",rownames(a1),value=TRUE)` (or `agrep` for the latter approach) – Ben Bolker May 02 '14 at 14:29
  • why would you choose a package based on name? for example, what the hell is a duh-plier anyway and who would need it? – rawr May 02 '14 at 14:33
  • Well. I was already digging `sos` package while I was asking the question. But still could not figure out how. – oakenshield1 May 02 '14 at 14:34
  • OK I admit that some packages names don't reflect their functionality but I believe that it'd be good for some packages. – oakenshield1 May 02 '14 at 14:37
  • 2
    Often I want to remember the name of the sos package but forget it. Luckily R user Dasonk has created the [findPackage](https://github.com/Dasonk/findPackage) package to help you remember the name of the sos package. – Tyler Rinker May 02 '14 at 20:28

1 Answers1

3

In addition to the sos package you may be interested in the RSiteSearch function which (given that you have a working internet connection) will search for keywords in all the packages on CRAN. By default it will search function help pages, vignettes, and the task views on CRAN and give you links to everything it finds (there are also options for the sorting) so you can see which package(s) are linked. You do not need to have the packages installed on your local machine like ?? or help.search. Also consider browsing through the task views on CRAN, they can tell you of packages that may be of interest and can also give advice on which package to use when there are multiple packages that appear to fit your needs.

Greg Snow
  • 48,497
  • 6
  • 83
  • 110