tvdb: Task Views (tvdb.rda)

tvdbR Documentation

Task Views (tvdb.rda)

Description

tvdb_down downloads from CRAN the file "Views.rds", a file refreshed every day that describes the task views available in CRAN for this day, rearranges the list in an alphabetical order and gives names to the list names, then loads in .GlobalEnv this list (of class ctvlist) under the name tvdb and saves it with the filename tvdb.rda.

tvdb_load loads the file filename in .GlobalEnv under the name tvdb. Equivalent to load("tvdb.rda").

tvdb_vec displays the list of the task views. There are 36 task views in August 2018.

tvdb_dfr extracts from tvdb a data.frame version, name, topic of the task views.

tvdb_list extracts from tvdb the list of the task views and the referenced packages.

tvdb_pkgs displays the packages referenced by one or several task views.

Visit s_crandb_tvdb to conduct task view maintenance.

Usage

tvdb_down(dir = ".", repos = getOption("repos")[1])

tvdb_load(filename = "tvdb.rda")

tvdb_vec(tvdb = get("tvdb", envir = .GlobalEnv))

tvdb_dfr(tvdb = get("tvdb", envir = .GlobalEnv))

tvdb_list(tvdb = get("tvdb", envir = .GlobalEnv))

tvdb_pkgs(..., char = NULL, tvdb = get("tvdb", envir = .GlobalEnv))

Arguments

dir

character. The directory where "tvdb.rda" is saved. Default value "." is the current directory.

repos

character. The address of your local CRAN.

filename

character. The path to file "tvdb.rda". The default is to read in the current directory.

tvdb

list. The list of the task views.

...

any format recognized by cnsc, except list. The names of one or several task views.

char

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

Examples

### DOWNLOAD AND VISUALIZE THE TASK VIEWS (tvdb)
## In real life, download tvdb from CRAN or load it from your directory
## with functions tvdb_down() or tvdb_load().
## In this example, we use a small file.
tvdb_load(system.file("data", "ztvdb.rda", package = "RWsearch"))
length(tvdb)

## List the task views
tvdb_vec()
tvdb_dfr()
tvdb_pkgs("Genetics")
lengths(tvdb_list())

## Here, 'lst' is subsetted from the small crandb file.
crandb_load(system.file("data", "zcrandb.rda", package = "RWsearch"))
funIN <- function (x, y) x[match(x, y, nomatch = 0)  > 0]
lst   <- lapply(tvdb_list()[1:2], funIN, crandb$Package) ; lst

if (interactive()) p_display7(lst[[1]], dir = file.path(tempdir(), "ptvdbdown"))


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