pkg_search: Search CRAN packages

View source: R/api.R

pkg_searchR Documentation

Description

pkg_search() starts a new search query, or shows the details of the previous query, if called without arguments.

ps() is an alias to pkg_search().

more() retrieves that next page of results for the previous query.

Usage

pkg_search(query = NULL, format = c("short", "long"), from = 1, size = 10)

ps(query = NULL, format = c("short", "long"), from = 1, size = 10)

more(format = NULL, size = NULL)

## S3 method for class 'pkg_search_result'
summary(object, ...)

## S3 method for class 'pkg_search_result'
print(x, ...)

Arguments

query

Search query string. If this argument is missing or NULL, then the results of the last query are printed, in short and long formats, in turns for successive pkg_search() calls. If this argument is missing, then all other arguments are ignored.

format

Default formatting of the results. short only outputs the name and title of the packages, long also prints the author, last version, full description and URLs. Note that this only affects the default printing, and you can still inspect the full results, even if you specify short here.

from

Where to start listing the results, for pagination.

size

The number of results to list.

object

Object to summarize.

...

Additional arguments, ignored currently.

x

Object to print.

Details

Note that the search needs a working Internet connection.

Value

A data frame with columns:

  • score: Score of the hit. See Section Scoring for some details.

  • package: Package name.

  • version: Latest package version.

  • title: Package title.

  • description: Short package description.

  • date: Time stamp of the last release.

  • maintainer_name: Name of the package maintainer.

  • maintainer_email: Email address of the package maintainer.

  • revdeps: Number of (strong and weak) reverse dependencies of the package.

  • downloads_last_month: Raw number of package downloads last month, from the RStudio CRAN mirror.

  • license: Package license.

  • url: Package URL(s).

  • bugreports: URL of issue tracker, or email address for bug reports.

Examples


# Example
ps("survival")

# Pagination
ps("networks")
more()

# Details
ps("visualization")
ps()

# See the underlying data frame
ps("ropensci")
ps()[]


r-hub/pkgsearch documentation built on Sept. 28, 2024, 10:55 p.m.