pkgsearch uses R-hub web services that munge CRAN metadata and let you access it through several lenses.

Installation

Install the latest pkgsearch release from CRAN:

install.packages("pkgsearch")

Usage

Do it all clicking

For the search mentioned above, and other points of entry to CRAN metadata, you can use pkgsearch RStudio add-in!

addin screeenshot

Select the “CRAN package search” addin from the menu, or start it with pkg_search_addin().

Get package metadata

Do you want to find the dependencies the first versions of testthat had and when each of these versions was released?

Search features

More details

By default it returns a short summary of the ten best search hits. Their details can be printed by using the format = "long" option of pkg_search(), or just calling pkg_search() again, without any arguments, after a search:

library(pkgsearch)
pkg_search("C++")
#> - "C++" ------------------------------------------------ 7925 packages in 0.007 seconds -
#> 
#> 1 Rcpp @ 1.0.3                                              Dirk Eddelbuettel, 6 days ago
#> --------------
#>   # Seamless R and C++ Integration
#>   The 'Rcpp' package provides R functions as well as C++ classes which offer a
#>   seamless integration of R and C++. Many R data types and objects can be mapped
#>   back and forth to C++ equivalents which facilitates both writing of new code
#>   as well as easier integration of third-party libraries. Documentation about
#>   'Rcpp' is provided by several vignettes included in this package, via the
#>   'Rcpp Gallery' site at <http://gallery.rcpp.org>, the paper by Eddelbuettel
#>   and Francois (2011, <doi:10.18637/jss.v040.i08>), the book by Eddelbuettel
#>   (2013, <doi:10.1007/978-1-4614-6868-4>) and the paper by Eddelbuettel and
#>   Balamuta (2018, <doi:10.1080/00031305.2017.1375990>); see 'citation("Rcpp")'
#>   for details.
#>   http://www.rcpp.org
#>   http://dirk.eddelbuettel.com/code/rcpp.html
#>   https://github.com/RcppCore/Rcpp
#> 
#> 2 BH @ 1.69.0.1                                          Dirk Eddelbuettel, 10 months ago
#> ---------------
#>   # Boost C++ Header Files
#>   Boost provides free peer-reviewed portable C++ source libraries.  A large part
#>   of Boost is provided as C++ template code which is resolved entirely at
#>   compile-time without linking.  This package aims to provide the most useful
#>   subset of Boost libraries for template use among CRAN package. By placing
#>   these libraries in this package, we offer a more efficient distribution system
#>   for CRAN as replication of this code in the sources of other packages is
#>   avoided. As of release 1.69.0-1, the following Boost libraries are included:
#>   'algorithm' 'align' 'any' 'atomic' 'bimap' 'bind' 'circular_buffer' 'compute'
#>   'concept' 'config' 'container' 'date_time' 'detail' 'dynamic_bitset'
#>   'exception' 'filesystem' 'flyweight' 'foreach' 'functional' 'fusion'
#>   'geometry' 'graph' 'heap' 'icl' 'integer' 'interprocess' 'intrusive' 'io'
#>   'iostreams' 'iterator' 'math' 'move' 'mpl' 'multiprcecision' 'numeric'
#>   'pending' 'phoenix' 'preprocessor' 'propery_tree' 'random' 'range'
#>   'scope_exit' 'smart_ptr' 'sort' 'spirit' 'tuple' 'type_traits' 'typeof'
#>   'unordered' 'utility' 'uuid'.
#> 
#> 3 markdown @ 1.1                                                  Yihui Xie, 3 months ago
#> ----------------
#>   # Render Markdown with the C Library 'Sundown'
#>   Provides R bindings to the 'Sundown' Markdown rendering library
#>   (<https://github.com/vmg/sundown>). Markdown is a plain-text formatting syntax
#>   that can be converted to 'XHTML' or other formats. See
#>   <http://en.wikipedia.org/wiki/Markdown> for more information about Markdown.
#>   https://github.com/rstudio/markdown
#> 
#> 4 StanHeaders @ 2.19.0                                         Ben Goodrich, 2 months ago
#> ----------------------
#>   # C++ Header Files for Stan
#>   The C++ header files of the Stan project are provided by this package, but it
#>   contains no R code or function documentation. There is a shared object
#>   containing part of the 'CVODES' library, but it is not accessible from R.
#>   'StanHeaders' is only useful for developers who want to utilize the
#>   'LinkingTo' directive of their package's DESCRIPTION file to build on the Stan
#>   library without incurring unnecessary dependencies. The Stan project develops
#>   a probabilistic programming language that implements full or approximate
#>   Bayesian statistical inference via Markov Chain Monte Carlo or 'variational'
#>   methods and implements (optionally penalized) maximum likelihood estimation
#>   via optimization. The Stan library includes an advanced automatic
#>   differentiation scheme, 'templated' statistical and linear algebra functions
#>   that can handle the automatically 'differentiable' scalar types (and doubles,
#>   'ints', etc.), and a parser for the Stan language. The 'rstan' package
#>   provides user-facing R functions to parse, compile, test, estimate, and
#>   analyze Stan models.
#>   http://mc-stan.org/
#> 
#> 5 inline @ 0.3.15                                     Dirk Eddelbuettel, about a year ago
#> -----------------
#>   # Functions to Inline C, C++, Fortran Function Calls from R
#>   Functionality to dynamically define R functions and S4 methods with 'inlined'
#>   C, C++ or Fortran code supporting the .C and .Call calling conventions.
#> 
#> 6 RcppProgress @ 0.4.1                                           Karl Forner, 2 years ago
#> ----------------------
#>   # An Interruptible Progress Bar with OpenMP Support for C++ in R Packages
#>   Allows to display a progress bar in the R console for long running
#>   computations taking place in c++ code, and support for interrupting those
#>   computations even in multithreaded code, typically using OpenMP.
#>   https://github.com/kforner/rcpp_progress
#> 
#> 7 SnowballC @ 0.6.0                                    Milan Bouchet-Valat, 10 months ago
#> -------------------
#>   # Snowball Stemmers Based on the C 'libstemmer' UTF-8 Library
#>   An R interface to the C 'libstemmer' library that implements Porter's word
#>   stemming algorithm for collapsing words to a common root to aid comparison of
#>   vocabulary. Currently supported languages are Danish, Dutch, English, Finnish,
#>   French, German, Hungarian, Italian, Norwegian, Portuguese, Romanian, Russian,
#>   Spanish, Swedish and Turkish.
#>   https://r-forge.r-project.org/projects/r-temis/
#> 
#> 8 covr @ 3.3.2                                                    Jim Hester, 29 days ago
#> --------------
#>   # Test Coverage for Packages
#>   Track and report code coverage for your package and (optionally) upload the
#>   results to a coverage service like 'Codecov' <http://codecov.io> or
#>   'Coveralls' <http://coveralls.io>. Code coverage is a measure of the amount of
#>   code being exercised by a set of tests. It is an indirect measure of test
#>   quality and completeness. This package is compatible with any testing
#>   methodology or framework and tracks coverage of both R code and compiled
#>   C/C++/FORTRAN code.
#>   https://covr.r-lib.org
#>   https://github.com/r-lib/covr
#> 
#> 9 glpkAPI @ 1.3.1                                         Mayo Roettger, about a year ago
#> -----------------
#>   # R Interface to C API of GLPK
#>   R Interface to C API of GLPK, depends on GLPK Version >= 4.42.
#> 
#> 10 RNifti @ 0.11.1                                              Jon Clayden, 3 months ago
#> ------------------
#>   # Fast R and C++ Access to NIfTI Images
#>   Provides very fast read and write access to images stored in the NIfTI-1 and
#>   ANALYZE-7.5 formats, with seamless synchronisation between compiled C and
#>   interpreted R code. Also provides a C/C++ API that can be used by other
#>   packages. Not to be confused with 'RNiftyReg', which performs image
#>   registration.
#>   https://github.com/jonclayden/RNifti

Ranking

The most important feature of a search engine is the ranking of the results. The best results should be listed first. pkgsearch uses weighted scoring, where a match in the package title gets a higher score than a match in the package description. It also uses the number of reverse dependencies and the number of downloads to weight the scores:

ps("colour")[, c("score", "package", "revdeps", "downloads_last_month")]

Preferring Phrases

The search engine prefers matching whole phrases over single words. E.g. the search phrase “permutation test” will rank coin higher than testthat, even though testthat is a much better result for the single word “test”. (In fact, at the time of writing testthat is not even on the first page of results.)

ps("permutation test")

If the whole phrase does not match, pkgsearch falls back to individual matching words. For example, a match from either words is enough here, to get on the first page of results:

ps("test http")

British vs American English

The search engine uses a dictionary to make sure that package metadata and queries given in British and American English yield the same results. E.g. note the spelling of colour/color in the results:

ps("colour")
ps("color")

More info

See the complete documentation.