Package Information

Usage

p_information(package = "base", ..., fields = NULL)
p_info(package = "base", ..., fields = NULL)

Arguments

package
Name of the package to grab information for. Default is "base".
fields
A character vector giving the tags of fields to return (for use inside of functions rather than ...).
...
Names of fields (see fields argument) to extract.

Package Information

Package Information

Value

Returns a list of fields.

Description

Provides the information from for a package from the NAMESPACE. Information may include: title, version, author, maintainer, description, depends, imports, suggests

Note

Note that the output from p_information (when no fields are passed) prints pretty but is actually an accessible list (use names(p_info()) test).

Examples

p_information()
Package: base Version: 3.2.0 Priority: base Title: The R Base Package Author: R Core Team and contributors worldwide Maintainer: R Core Team <R-core@r-project.org> Description: Base R functions. License: Part of R 3.2.0 Built: R 3.2.0; ; 2015-02-14 03:18:45 UTC; windows -- File: C:/R/R-devel/library/base/Meta/package.rds
p_info()
Package: base Version: 3.2.0 Priority: base Title: The R Base Package Author: R Core Team and contributors worldwide Maintainer: R Core Team <R-core@r-project.org> Description: Base R functions. License: Part of R 3.2.0 Built: R 3.2.0; ; 2015-02-14 03:18:45 UTC; windows -- File: C:/R/R-devel/library/base/Meta/package.rds
names(p_info())
[1] "Package" "Version" "Priority" "Title" "Author" "Maintainer" "Description" "License" [9] "Built"
p_info()[names(p_info())]
$Package [1] "base" $Version [1] "3.2.0" $Priority [1] "base" $Title [1] "The R Base Package" $Author [1] "R Core Team and contributors worldwide" $Maintainer [1] "R Core Team <R-core@r-project.org>" $Description [1] "Base R functions." $License [1] "Part of R 3.2.0" $Built [1] "R 3.2.0; ; 2015-02-14 03:18:45 UTC; windows"
p_info(pacman)
Package: pacman Type: Package Title: Package Management Tool Version: 0.3.0 Date: 2012-06-03 Authors@R: c(person("Tyler", "Rinker", role = c("aut", "cre", "ctb"), email = "tyler.rinker@gmail.com"), person("Dason", "Kurkiewicz", role = c("aut", "ctb"), email = "dasonk@iastate.edu")) Author: Tyler Rinker [aut, cre, ctb], Dason Kurkiewicz [aut, ctb] Maintainer: Tyler Rinker <tyler.rinker@gmail.com> Depends: R (>= 2.13.0) Imports: devtools Suggests: knitr, lattice, testthat, XML BugReports: https://github.com/trinker/pacman/issues?state=open Description: Tools to more conveniently perform tasks associated with add on packages. pacman conveniently wraps library and package related functions and names them in an intuitive and consistent fashion. It seeks to combine functionality from lower level functions which can speed up workflow. License: GPL-2 URL: https://github.com/trinker/pacman Roxygen: list(wrap = FALSE) VignetteBuilder: knitr -- File: C:\Users\Tyler\GitHub\pacman/DESCRIPTION
p_info(pacman, Author)
$Author [1] "Tyler Rinker [aut, cre, ctb], Dason Kurkiewicz [aut, ctb]"
p_info(pacman, BugReports, URL)
$BugReports [1] "https://github.com/trinker/pacman/issues?state=open" $URL [1] "https://github.com/trinker/pacman"
p_info(pacman, fields = "Version")
$Version [1] "0.3.0"
## <strong>Not run</strong>: # p_extract(p_info(ggplot2, "Depends")) # p_extract(p_info(ggplot2, "Imports")) # lapply(p_info(ggplot2, "Imports", "Depends", "Suggests"), p_extract) # ## <strong>End(Not run)</strong>

See also

packageDescription, p_information