findPackage {packagefinder} | R Documentation |
Searching for packages on CRAN
Description
Searches for packages on CRAN based on the user's specification of search terms. Considers the package name, description as well as the long description, and prioritizes the results.
Usage
findPackage(
keywords = NULL,
query = NULL,
mode = "or",
case.sensitive = FALSE,
always.sensitive = NULL,
weights = c(2, 2, 1, 2),
display = "viewer",
results.longdesc = FALSE,
limit.results = 15,
silent = FALSE,
index = NULL,
advanced.ranking = TRUE,
return.df = FALSE,
clipboard = FALSE
)
Arguments
keywords |
A vector of keywords to be searched for. Instead of separate search terms, |
query |
A vector of regular expressions (regex) to match against package name and descriptions; alternative to |
mode |
Indicates whether the search terms in |
case.sensitive |
Indicates if the search shall be case sensitive, or not. |
always.sensitive |
A vector of search terms for which capitalization is always considered relevant (even if |
weights |
A numeric vector describing how search hits in different fields of the a package's data shall be weighted. The first three elements of the vector are the weights assigned to hits in the package's title, short description and long description, respectively. The fourth element is a factor applied to the overall score of a search hit if all search terms from the |
display |
Describes where the search results shall be shown. Either |
results.longdesc |
Indicates whether the packages' long descriptions shall also be included in the search results. Given the length of some long decsriptions this may make the search results harder to read. |
limit.results |
The maximum number of matches presented in the search results; choose a negative number to display all results |
silent |
Indicates whether any visible output is produced. Use |
index |
Either a path (or URL) to a search index, or a search index that is already loaded. If no index is provided, |
advanced.ranking |
Indicates if the ranking of search results shall be based on weights taking into account the inverse frequencies of the different search terms across all packages and the length of the matches relative to the texts they were found in. Usually, using advanced ranking ( |
return.df |
If |
clipboard |
If |
Details
The GO
column in the search results is an index number that can be used to address the found package easily with the go()
function.
The Total Downloads
column in the search results gives the overall number of downloads of the respective package since its submission to CRAN. The number is based on the figures for the RStudio CRAN mirror server.
This field is only provided if the search index contains download figures. Ad hoc indices (when index = NULL
) never include download statistics. Please refer to buildIndex()
for more details.
fp()
is a shorter alias for findPackage()
.
Value
The search results as a dataframe, if df.return = TRUE
.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
search <- c("regression", "meta")
findPackage(search)
findPackage(c("text", "tables"))
searchindex <- buildIndex()
findPackage(keywords=c("regression", "linear"), mode="and",
always.sensitive="GLM", index=searchindex)
findPackage("meta and regression", display="console")
# Alternatively, show results in browser
# findPackage("meta and regression", display="browser")
my.results <- findPackage("meta AND regression")