s_crandb {RWsearch} | R Documentation |
Search Packages by Keywords in data.frame crandb
Description
The most important functions in this package along with p_down
.
Search packages in data.frame crandb
that contain one or several keywords
in the columns "Package", "Title", "Description", "Author" or "Maintainer".
s_crandb
returns a vector of the packages that contain the keywords.
s_crandb_list
returns a list where each element of the list is one of the
keywords.
s_crandb_PTD
returns a list split by results in columns "Package", "Title"
and "Description". Option mode = "and", "relax"
is ignored.
s_crandb_AM
returns a list split by results in columns "Author" and
"Maintainer". Option mode = "and", "relax"
is ignored.
Use p_table2
to print the results of s_crandb
and
s_crandb_list
in the console.
Use p_text
to send the results in txt, md or pdf files.
Use p_display
to visualize the results in html pages in the browser.
Usage
s_crandb(..., char = NULL, select = "PTD", mode = "or",
sensitive = FALSE, perl = FALSE, fixed = FALSE, agrep = FALSE,
max.distance = 0.1, costs = NULL, crandb = get("crandb", envir =
.GlobalEnv))
s_crandb_list(..., char = NULL, select = "PTD", mode = "or",
sensitive = FALSE, perl = FALSE, fixed = FALSE, agrep = FALSE,
max.distance = 0.1, costs = NULL, crandb = get("crandb", envir =
.GlobalEnv))
s_crandb_PTD(..., char = NULL, mode = "or", sensitive = FALSE,
perl = FALSE, fixed = FALSE, agrep = FALSE, max.distance = 0.1,
costs = NULL, crandb = get("crandb", envir = .GlobalEnv))
s_crandb_AM(..., char = NULL, mode = "or", sensitive = FALSE,
perl = FALSE, fixed = FALSE, agrep = FALSE, max.distance = 0.1,
costs = NULL, crandb = get("crandb", envir = .GlobalEnv))
Arguments
... |
any format recognized by |
char |
(name to) a character vector. Use this argument if |
select |
character vector. A sub-vector of |
mode |
character among "or", "and", "relax". The search mode.
"relax" is for 3 words and more. It is an intermediate between
"or" and "and" as it requires just 2 matching words:
|
sensitive |
logical. |
perl |
logical. Used only if |
fixed |
logical. |
agrep |
logical. For approximate matching, use |
max.distance |
integer or numeric. See |
costs |
NULL or list. See |
crandb |
data.frame |
Examples
## In real life, download crandb from CRAN or load it from your directory
## with functions crandb_down() or crandb_load().
## In this example, we use a small file.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
## Search using standard or non-standard content
s_crandb(c("thermodynamic", "chemical reaction", "distillation"))
s_crandb_list(thermodynamic, "chemical reaction", distillation)
## Search using the various options
s_crandb("^f", select = "P")
s_crandb(pH, sensitive = TRUE)
s_crandb_PTD(pH, sensitive = TRUE)
s_crandb_PTD("C++", fixed = TRUE)
s_crandb(search, find, cran, web, select = "PD", mode = "and")
s_crandb(search, find, cran, web, select = "PD", mode = "relax")
s_crandb(search, find, cran, web, select = "PD", mode = "or")
## Search for some authors using the various options
s_crandb_AM(Kiener, Dutang, ORPHANED)
## Non-standard content can be unquoted words or objects in .GlobalEnv
## They are transformed into character or are evaluated
## Here, the searched keywords are "find" and "search".
OTHER <- "search"
(lst <- s_crandb_list(find, OTHER, select = "P", sensitive = TRUE))
## Display in the browser this list of packages
if (interactive()) {
p_display5(lst, dir = file.path(tempdir(), "scrandb"))
}