Title: | CRAN Task Views |
---|---|
Description: | Infrastructure for task views to CRAN-style repositories: Querying task views and installing the associated packages (client-side tools), generating HTML pages and storing task view information in the repository (server-side tools). |
Authors: | Achim Zeileis [aut, cre] , Kurt Hornik [aut] |
Maintainer: | Achim Zeileis <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 0.9-6 |
Built: | 2024-11-26 11:42:48 UTC |
Source: | CRAN |
Client-side tools for installing CRAN task views.
ctv(view, repos = NULL, ...) available.views(repos = NULL, ...) install.views(views, coreOnly = FALSE, repos = NULL, ...) update.views(views, coreOnly = FALSE, repos = NULL, lib.loc = NULL, filters = NULL, ...) download.views(views, destdir, coreOnly = FALSE, repos = NULL, ...) ## S3 method for class 'ctv' print(x, packagelist = TRUE, ...) ## S3 method for class 'ctvlist' print(x, packagelist = FALSE, ...)
ctv(view, repos = NULL, ...) available.views(repos = NULL, ...) install.views(views, coreOnly = FALSE, repos = NULL, ...) update.views(views, coreOnly = FALSE, repos = NULL, lib.loc = NULL, filters = NULL, ...) download.views(views, destdir, coreOnly = FALSE, repos = NULL, ...) ## S3 method for class 'ctv' print(x, packagelist = TRUE, ...) ## S3 method for class 'ctvlist' print(x, packagelist = FALSE, ...)
view , views
|
character vector with the short names of the task views whose
associated packages should be downloaded and installed. Alternatively,
|
coreOnly |
logical. Should all packages or only core packages be installed?
(recycled to the same length as |
repos |
character, the base URL of the repository. By default |
lib.loc |
character vector describing the location of R library trees to search through (and update packages therein). |
filters |
a character vector or list to filter
|
destdir |
directory where downloaded packages are to be stored. |
... |
further arguments passed to |
x |
an object of class |
packagelist |
logical. Should the packagelist also be printed? |
install.views
queries the file ‘Views.rds’ located at
the ‘src/contrib’ directory of ‘repos’ and then simply calls
install.packages
to install the packages associated with the
view specified. For each view it can be specified whether all packages or
only the core packages should be installed.
available.views
returns the list of task views currently
available in the file ‘Views.rds’. In earlier versions, this was called
CRAN.views
(which still works and provides the same functionality).
update.views
queries which packages from a view are not yet
installed (using installed.packages
) and which of the installed
packages are older than the packages available (using available.packages
).
It subsequently installs only the packages that are not current or not
installed yet.
download.views
works exactly as install.views
except that it calls
download.packages
instead of install.packages
.
For a more detailed description of the arguments see also install.packages
.
available.views
returns an object of class "ctvlist"
of the
available task views whose elements are of class "ctv"
.
install.views
and update.views
have no return value.
## Not run: ## query only a single view (with known name) ctv("Econometrics") ## extract corresponding citation ctv("Econometrics")$citation ## query list of CRAN task views available available.views() ## install Econometrics view install.views("Econometrics") ## only with core packages install.views("Econometrics", coreOnly = TRUE) ## update Econometrics view (i.e. only packages that are not current anyway) update.views("Econometrics") ## End(Not run)
## Not run: ## query only a single view (with known name) ctv("Econometrics") ## extract corresponding citation ctv("Econometrics")$citation ## query list of CRAN task views available available.views() ## install Econometrics view install.views("Econometrics") ## only with core packages install.views("Econometrics", coreOnly = TRUE) ## update Econometrics view (i.e. only packages that are not current anyway) update.views("Econometrics") ## End(Not run)
Server-side tools for maintaining CRAN task views.
read.ctv(file, ...) ctv2html(x, file = NULL, cran = FALSE, css = NULL, packageURL = NULL, reposname = "CRAN") check_ctv_packages(file, repos = TRUE, ...) repos_update_views(repos = ".", cran = TRUE, css = NULL, reposname = "CRAN", ...)
read.ctv(file, ...) ctv2html(x, file = NULL, cran = FALSE, css = NULL, packageURL = NULL, reposname = "CRAN") check_ctv_packages(file, repos = TRUE, ...) repos_update_views(repos = ".", cran = TRUE, css = NULL, reposname = "CRAN", ...)
file |
character specifying a file path: for |
x |
an object of class |
cran |
logical. Is the HTML to be hosted on CRAN? |
css |
character specifying the path and name of the cascade style
sheet that should be included in the HTML files (if any). The default
is |
packageURL |
character specifying the path (relative to the view directory)
to the package descriptions. The default is |
reposname |
character giving the name of the CRAN-style repository, used for generating HTML pages. |
repos |
character, the base URL of the CRAN-style repository where the ‘Views.rds’
and ‘.html’ files should be installed. The task view files should
be located in the ‘web/views/’ directory. If |
... |
further arguments passed to |
CRAN Task views are generated from an R/Markdown-based file format that is described in the vignette of this package. (Previous versions used an XML-based format which is still fully supported in all functions.)
read.ctv
can read a file with a CRAN task view specification
and returns an object of class "ctv"
. This functions requires the availability
of the knitr/rmarkdown packages (or the xml2 package, respectively,
for the legacy XML format).
ctv2html
generates a ‘.html’ file with the information contained in
a "ctv"
object.
check_ctv_packages
checks whether the info and packagelist sections of the
task view file are consistent with each other and whether all packages are available
from the repository.
repos_update_views
reads all task view files in a specified directory, generates
a ‘.html’ file for each and an index ‘.html’ file. Furthermore, it stores
all "ctv"
objects in a "ctvlist"
object in a file ‘Views.rds’ that can be queried
by install.views
or CRAN.views
.
repos_update_views
returns an object of class "ctvlist"
containing
the "ctv"
objects available.
ctv2html
returns invisibly a vector with the HTML code generated.
check_ctv_packages
returns a list of character vectors with package names.
read.ctv
returns a list of class "ctv"
with elements:
name |
character, name of the task view (must be a valid name for an R object). |
topic |
character, topic of the task view. |
maintainer |
character, maintainer of the task view. |
email |
character, valid e-mail address (optional). |
version |
character, version specified via date in ISO format. |
url |
character, valid task view URL (optional). |
source |
character, source repository where the task view file is maintained (optional). |
info |
character, HTML code with informations about the task view. |
packagelist |
data frame with the columns |
links |
character vector, HTML code with links for the task view. |
otherlinks |
character vector, HTML code with links to other resources for the task view. |
citation |
citation object inheriting from |
## task view file shipped within the package ctv <- system.file("ctv", "Econometrics.md", package = "ctv") if(require("knitr") & require("rmarkdown")) { ## read task view file x <- read.ctv(ctv) ## print x } ## Not run: ## generate corresponding .html file from task view object ctv2html(x) ## or equivalently from task view file ctv2html(ctv) ## check packagelist check_ctv_packages(ctv) ## End(Not run)
## task view file shipped within the package ctv <- system.file("ctv", "Econometrics.md", package = "ctv") if(require("knitr") & require("rmarkdown")) { ## read task view file x <- read.ctv(ctv) ## print x } ## Not run: ## generate corresponding .html file from task view object ctv2html(x) ## or equivalently from task view file ctv2html(ctv) ## check packagelist check_ctv_packages(ctv) ## End(Not run)