p_display: Display Package Information in HTML Pages

View source: R/p_display.R

p_displayR Documentation

Display Package Information in HTML Pages

Description

p_display, p_display5 and p_display7 open the default browser and display the results of p_table, p_table5 and p_table7 in one or several html pages. If ... (or char) is a list, several pages are opened.

Usage

p_display(..., char = NULL, columns = c("Package", "Title", "Description"),
  dir = tempdir(), verbose = FALSE, crandb = get("crandb", envir =
  .GlobalEnv))

p_display5(..., char = NULL, dir = tempdir(), verbose = FALSE,
  crandb = get("crandb", envir = .GlobalEnv))

p_display7(..., char = NULL, dir = tempdir(), verbose = FALSE,
  crandb = get("crandb", envir = .GlobalEnv))

Arguments

...

any format recognized by cnsc, including list. A vector or a list of packages. Or a vector or a list of data.frame produced by p_table.

char

(name to) a character vector. Use this argument if ... fails or if you call the function from another function. If used, argument ... is ignored.

columns

character vector. A sub-vector of colnames(crandb). The short form "P", "T", "D", "PT", "PD", "TD", "PTD", "A", "M", "AM" describing the Package name, Title, Description, Author, Maintainer or a combination of them is accepted.

dir

character. The directory in which the html file(s) is (are) saved. tempdir() or getwd() are common paths.

verbose

logical. List the generated html file(s).

crandb

data.frame crandb. The data.frame of CRAN packages.

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.
## No package has the 'distillation' keyword. An empty table is returned.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
(lst <- s_crandb_list("thermodynamic", "chemical reaction", "distillation"))

if (interactive()) {
dir <- file.path(tempdir(), "pdisplay")

## Vector => 1 page
p_display(RWsearch, pacman, pdfsearch, sos, brew, dir = dir)

## List with 3 items => 3 pages with one empty
p_display5(lst, dir = dir)
}

RWsearch documentation built on March 18, 2022, 5:17 p.m.