Package 'pkgsearch'

Title: Search and Query CRAN R Packages
Description: Search CRAN metadata about packages by keyword, popularity, recent activity, package name and more. Uses the 'R-hub' search server, see <https://r-pkg.org> and the CRAN metadata database, that contains information about CRAN packages. Note that this is _not_ a CRAN project.
Authors: Gábor Csárdi [aut, cre], Maëlle Salmon [aut] , R Consortium [fnd]
Maintainer: Gábor Csárdi <[email protected]>
License: MIT + file LICENSE
Version: 3.1.3.9000
Built: 2024-06-21 05:01:11 UTC
Source: https://github.com/r-hub/pkgsearch

Help Index


List of all CRAN events (new, updated, archived packages)

Description

List of all CRAN events (new, updated, archived packages)

Usage

cran_events(releases = TRUE, archivals = TRUE, limit = 10, from = 1)

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

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

Arguments

releases

Whether to include package releases.

archivals

Whether to include package archivals.

limit

Number of events to list.

from

Where to start the list, for pagination.

object

Object to summarize.

...

Additional arguments are ignored currently.

x

Object to print.

Value

List of events.

Examples

cran_events()
cran_events(limit = 5, releases = FALSE)
cran_events(limit = 5, archivals = FALSE)
summary(cran_events(limit = 10))

New CRAN packages

Description

List the latest new CRAN packages.

Usage

cran_new(from = "last-week", to = "now", last = Inf)

Arguments

from

Start of the time interval to query. Possible values:

  • "last-week"

  • "last-month"

  • A Date object to be used as a start date.

  • A POSIXt object to be used as the start date.

  • A difftime object to used as the time interval until now.

  • An integer scalar, the number of days until today.

  • A character string that is converted to a start date using as.POSIXct().

to

End of the time interval to query. It accepts the same kinds of values as from, and additionally it can also be the string "now", to specify the current date and time.

last

Integer to limit the number of returned packages.

Value

Data frame of package descriptions.

Examples

# Last week
cran_new("last-week")

# Last month
cran_new("last-month")

# Last 5 days
cran_new(from = 5)

# From a given date, but at most 10
cran_new(from = "2021-04-06", last = 10)

# March of 2021
cran_new(from = "2021-03-01", to = "2021-04-01")

Metadata about a CRAN package

Description

Metadata about a CRAN package

Usage

cran_package(name, version = NULL)

Arguments

name

Name of the package.

version

The package version to query. If NULL, the latest version if returned.

Value

The package metadata, in a named list.

Examples

cran_package("pkgsearch")

Query the history of a package

Description

Query the history of a package

Usage

cran_package_history(package)

Arguments

package

Package name.

Value

A data frame, with one row per package version.

Examples

cran_package_history("igraph")

Metadata about multiple CRAN packages

Description

Metadata about multiple CRAN packages

Usage

cran_packages(names)

Arguments

names

Package names. May also contain versions, separated by a @ character.

Value

A data frame of package metadata, one package per row.

Examples

# Get metadata about one package
cran_packages("rhub")
# Get metadata about two packages
cran_packages(c("rhub", "testthat"))
# Get metadata about two packages at given versions
cran_packages(c("[email protected]", "[email protected]", "[email protected]"))
# If a version does not exist nothing is returned
cran_packages("rhub@notaversion")

Top downloaded packages

Description

Last week.

Usage

cran_top_downloaded()

Details

You can use the cranlogs package to get more flexibility into what is returned.

Value

Data frame of top downloaded packages.

Examples

cran_top_downloaded()

RStudio addin to search CRAN packages

Description

Call this function from RStudio for best results. You can also use it without RStudio, then it will run in the web browser.

Usage

pkg_search_addin(query = "", viewer = c("dialog", "browser"))

Arguments

query

Query string to start the addin with.

viewer

Whether to show the addin within RStudio ("dialog"), or in a web browser ("browser").

Details

The app has:

  • A search tab for free text search, very much like the pkg_search() function.

  • The list of recently updated packages.

  • The list of top packages: most downloaded, most depended upon, and trending packages.

  • Package list by maintainer.

Examples

pkg_search_addin()

# Start with a search query
pkg_search_addin("permutation test")