Type: | Package |
Title: | Comfortable Search for R Packages on CRAN, Either Directly from the R Console or with an R Studio Add-in |
Version: | 0.3.5 |
Maintainer: | Joachim Zuckarelli <joachim@zuckarelli.de> |
Description: | Search for R packages on CRAN directly from the R console, based on the packages' titles, short and long descriptions, or other fields. Combine multiple keywords with logical operators ('and', 'or'), view detailed information on any package and keep track of the latest package contributions to CRAN. If you don't want to search from the R console, use the comfortable R Studio add-in. |
License: | GPL-3 |
Encoding: | UTF-8 |
BugReports: | https://github.com/jsugarelli/packagefinder/issues |
URL: | https://github.com/jsugarelli/packagefinder/, http://www.zuckarelli.de/packagefinder/tutorial.html, https://youtu.be/B96NMSo3nJI |
Repository: | CRAN |
ByteCompile: | true |
Imports: | httr, utils, jsonlite, pander, formattable, stringr, crayon, lubridate, tidyr, textutils, htmlTable, clipr, shiny, reactable, shinyjs, shinybusy |
Depends: | tools (≥ 3.4.0) |
RoxygenNote: | 7.1.1 |
NeedsCompilation: | no |
Packaged: | 2023-08-07 20:54:42 UTC; zucka |
Author: | Joachim Zuckarelli
|
Date/Publication: | 2023-08-08 10:30:02 UTC |
Creating a search index for findPackage()
Description
Builds a search index that can be used with findPackage()
.
Usage
buildIndex(filename = "", download.stats = FALSE)
Arguments
filename |
Name of .rdata file to which the new index is saved. |
download.stats |
Indicates if the search index shall include download figures from the RStudio CRAN mirror logs. |
Details
Functions like findPackage()
or go()
require a search index. This search index can either be created on-the-fly or be provided as a separate argument. In the latter case a search index can be built using buildIndex()
. This index can include download figures for the packages
(this feature is turned on with download.stats = TRUE
). Including download stats requires significant time (may well be > 1 hour) for the index to be built. Therefore, when findPackage()
is called without
providing an index, the index that is created on-the-fly does not contain CRAN download figures.
Value
Returns the search index. As a side effect, the index is saved to a file, if a filename is provided via the filename
argument.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
index <- buildIndex(filename = file.path(tempdir(), "searchindex.rdata"), download.stats = FALSE)
Searching for packages on CRAN
Description
Searches for packages on CRAN by scanning a specified set of information fields for a user-provided search term.
Usage
exploreFields(
term,
fields = c("Name", "Description", "LongDescription"),
mode = "or",
match = "like",
display = "viewer",
index = NULL
)
Arguments
term |
Search term to look for; character vector must have one element. |
fields |
The list of fields to be scanned for the search term; must be a character vector with one or more field names. Allowed field names are: |
mode |
Indicates whether matches in the field shall be combined with a logical OR or with a logical AND; accordingly, permitted values are |
match |
Either |
display |
Describes where the search results shall be shown. Either |
index |
Either a path (or URL) to a search index, or a search index that is already loaded. If no index is provided, |
Details
Found packages are listed in alphabetical order, there is no prioritization of search hits as in findPackage()
.
Value
No return value.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
exploreFields("Hadley", c("Maintainer", "Authors@R", "Author"))
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")
Searching for packages on CRAN
Description
Shorter alias for function findPackage()
.
Usage
fp(...)
Arguments
... |
Arguments as in |
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
fp(c("meta", "regression"))
Showing information about a package
Description
Allows to inspect a package found with findPackage()
by showing detailed CRAN information on the package, opening its manual (PDF) or pulling up the package's website. Also allows to install the package right away.
Usage
go(package, where.to = "details", index = NULL)
Arguments
package |
Either the name of the package (capitalization does generally not matter) or the search result number shown in the results of |
where.to |
Either |
index |
Either a path (or URL) to a search index, or a search index that is already loaded. If no index is provided, |
Details
go()
is made to inspect a package found with findPackage()
and to decide whether or not this package serves the intended purposes.
Value
No return value.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Searching for packages on CRAN
Description
Shows the results of the last search with findPackage()
.
Usage
lastResults(display = "viewer")
Arguments
display |
Describes where the search results shall be shown. Either |
Value
No return value.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Showing information about a package
Description
Shows detailed CRAN information for a package.
Usage
packageDetails(package, brief = FALSE, show.tip = TRUE, index = NULL)
Arguments
package |
Either the name of a package (capitalization does generally not matter) or the search result number shown in the results of |
brief |
If |
show.tip |
If |
index |
Either a path (or URL) to a search index, or a search index that is already loaded. If no index is provided, |
Value
No return value.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
packageDetails("ggplot2")
Package 'packagefinder'
Description
Comfortable search for R packages on CRAN directly from the R console
What is packagefinder? How does it benefit me?
Currently, there are more than 16,000 R package contributions on CRAN providing R with an unparalleled wealth of features. The downside of the large and increasing amount of packages is that it becomes increasingly difficult to find the right tools to tackle a specific problem. Unfortunately, CRAN does not provide any good search functionality.
packagefinder is designed to search for CRAN packages right from the R console. The philosophy behind this package is that R users like using the R console and need a tool to do their day-to-day-work on CRAN without leaving their normal workspace, the console. In fact, the idea is that with packagefinder you do not need to leave the R console to work with CRAN effectively.
packagefinder is developed to save you time and energy finding the right packages to work with, thereby making your work with R more productive.
Where can I get more information?
Contact the author:
E-mail: Joachim Zuckarelli (joachim@zuckarelli.de)
Twitter: @jsugarelli
packagefinder introduction: A Quick Tutorial
packagefinder on GitHub: https://github.com/jsugarelli/packagefinder
packagefinder video tutorial on YouTube: https://youtu.be/B96NMSo3nJI (discusses version 0.1.5)
Staying up-to-date on CRAN packages
Description
Shows information on the latest package additions to CRAN.
Usage
whatsNew(last.days = 0, brief = TRUE, index = NULL)
Arguments
last.days |
The length of the period (in days) for which package additions to CRAN shall be presented. |
brief |
Determines if all avalilable package description fields shall be shown ( |
index |
Either a path (or URL) to a search index, or a search index that is already loaded. If no index is provided, |
Value
Number of packages covered by the period specified in last.days
.
Author(s)
Joachim Zuckarelli joachim@zuckarelli.de
Examples
whatsNew(last.days = 3)