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

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".

...

Names of fields (see fields argument) to extract.

fields

A character vector giving the tags of fields to return (for use inside of functions rather than ...).

Value

Returns a list of fields.

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).

See also

packageDescription, p_information

Examples

p_information()
#> Package: base
#> Version: 4.4.1
#> Priority: base
#> Title: The R Base Package
#> Author: R Core Team and contributors worldwide
#> Maintainer: R Core Team <do-use-Contact-address@r-project.org>
#> Contact: R-help mailing list <r-help@r-project.org>
#> Description: Base R functions.
#> License: Part of R 4.4.1
#> Suggests: methods
#> Enhances: chron, date, round
#> Built: R 4.4.1; ; 2024-08-22 01:53:23 UTC; unix
#> 
#> -- File: /opt/R/4.4.1/lib/R/library/base/Meta/package.rds 
p_info()
#> Package: base
#> Version: 4.4.1
#> Priority: base
#> Title: The R Base Package
#> Author: R Core Team and contributors worldwide
#> Maintainer: R Core Team <do-use-Contact-address@r-project.org>
#> Contact: R-help mailing list <r-help@r-project.org>
#> Description: Base R functions.
#> License: Part of R 4.4.1
#> Suggests: methods
#> Enhances: chron, date, round
#> Built: R 4.4.1; ; 2024-08-22 01:53:23 UTC; unix
#> 
#> -- File: /opt/R/4.4.1/lib/R/library/base/Meta/package.rds 
names(p_info())
#>  [1] "Package"     "Version"     "Priority"    "Title"       "Author"     
#>  [6] "Maintainer"  "Contact"     "Description" "License"     "Suggests"   
#> [11] "Enhances"    "Built"      
p_info()[names(p_info())]
#> $Package
#> [1] "base"
#> 
#> $Version
#> [1] "4.4.1"
#> 
#> $Priority
#> [1] "base"
#> 
#> $Title
#> [1] "The R Base Package"
#> 
#> $Author
#> [1] "R Core Team and contributors worldwide"
#> 
#> $Maintainer
#> [1] "R Core Team <do-use-Contact-address@r-project.org>"
#> 
#> $Contact
#> [1] "R-help mailing list <r-help@r-project.org>"
#> 
#> $Description
#> [1] "Base R functions."
#> 
#> $License
#> [1] "Part of R 4.4.1"
#> 
#> $Suggests
#> [1] "methods"
#> 
#> $Enhances
#> [1] "chron, date, round"
#> 
#> $Built
#> [1] "R 4.4.1; ; 2024-08-22 01:53:23 UTC; unix"
#> 
p_info(pacman)
#> Package: pacman
#> Type: Package
#> Title: Package Management Tool
#> Version: 0.5.2
#> 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@gmail.com"), person("Keith", "Hughitt", role =
#>         c("ctb")), person("Albert", "Wang", role = c("ctb")),
#>         person("Garrick", "Aden-Buie", role = c("ctb")),
#>         person("Albert", "Wang", role = c("ctb")), person("Lukas",
#>         "Burk", role = c("ctb")))
#> Depends: R (>= 3.5.0)
#> Imports: remotes, methods, stats, utils
#> Suggests: BiocManager, knitr, lattice, testthat (>= 0.9.0), 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)
#> RoxygenNote: 6.1.1
#> Author: Tyler Rinker [aut, cre, ctb], Dason Kurkiewicz [aut, ctb],
#>         Keith Hughitt [ctb], Albert Wang [ctb], Garrick Aden-Buie
#>         [ctb], Albert Wang [ctb], Lukas Burk [ctb]
#> Maintainer: Tyler Rinker <tyler.rinker@gmail.com>
#> Built: R 4.4.1; ; 2025-05-13 20:10:14 UTC; unix
#> 
#> -- File: /tmp/RtmpcB2IS2/temp_libpath3d2ca832a7b3f7/pacman/Meta/package.rds 
p_info(pacman, Author)
#> $Author
#> [1] "Tyler Rinker [aut, cre, ctb], Dason Kurkiewicz [aut, ctb], Keith Hughitt [ctb], Albert Wang [ctb], Garrick Aden-Buie [ctb], Albert Wang [ctb], Lukas Burk [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.5.2"
#> 
if (FALSE) { # \dontrun{
p_extract(p_info(ggplot2, "Depends"))
p_extract(p_info(ggplot2, "Imports"))
lapply(p_info(ggplot2, "Imports", "Depends", "Suggests"), p_extract)
} # }