GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • rdrr.io
  • Find an R package
  • R language docs
  • Run R in your browser

This view

  • Original page
  • New address

GeezerVison is showing rdrr.io — packageDescription: Package Description

Home
/
R Documentation
/
utils
/
packageDescription: Package Description

packageDescription: Package Description

packageDescriptionR Documentation

Package Description

Description

Parses and returns the ‘DESCRIPTION’ file of a package as a "packageDescription".

Utility functions return (transformed) parts of that.

Usage

packageDescription(pkg, lib.loc = NULL, fields = NULL,
                   drop = TRUE, encoding = "")
packageVersion(pkg, lib.loc = NULL)
packageDate(pkg, lib.loc = NULL,
            date.fields = c("Date", "Packaged", "Date/Publication", "Built"),
            tryFormats = c("%Y-%m-%d", "%Y/%m/%d", "%D", "%m/%d/%y"),
            desc = packageDescription(pkg, lib.loc=lib.loc, fields=date.fields))
asDateBuilt(built)

Arguments

pkg

a character string with the package name.

lib.loc

a character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. If the default is used, the loaded packages and namespaces are searched before the libraries.

fields

a character vector giving the tags of fields to return (if other fields occur in the file they are ignored).

drop

If TRUE and the length of fields is 1, then a single character string with the value of the respective field is returned instead of an object of class "packageDescription".

encoding

If there is an Encoding field, to what encoding should re-encoding be attempted? If NA, no re-encoding. The other values are as used by iconv, so the default "" indicates the encoding of the current locale.

date.fields

character vector of field tags to be tried. The first for which as.Date(.) is not NA will be returned. (Partly experimental, see Note.)

tryFormats

date formats to try, see as.Date.character().

desc

optionally, a named list with components named from date.fields; where the default is fine, a complete packageDescription() maybe specified as well.

built

for asDateBuilt(), a character string as from packageDescription(*, fields="Built").

Details

A package will not be ‘found’ unless it has a ‘DESCRIPTION’ file which contains a valid Version field. Different warnings are given when no package directory is found and when there is a suitable directory but no valid ‘DESCRIPTION’ file.

An attached environment named to look like a package (e.g., package:utils2) will be ignored.

packageVersion() is a convenience shortcut, allowing things like if (packageVersion("MASS") < "7.3") { do.things } .

For packageDate(), if desc is valid, both pkg and lib.loc are not made use of.

Value

If a ‘DESCRIPTION’ file for the given package is found and can successfully be read, packageDescription returns an object of class "packageDescription", which is a named list with the values of the (given) fields as elements and the tags as names, unless drop = TRUE.

If parsing the ‘DESCRIPTION’ file was not successful, it returns a named list of NAs with the field tags as names if fields is not null, and NA otherwise.

packageVersion() returns a (length-one) object of class "package_version".

packageDate() will return a "Date" object from as.Date() or NA.

asDateBuilt(built) returns a "Date" object or signals an error if built is invalid.

Note

The default behavior of packageDate(), notably for date.fields, is somewhat experimental and may change. Using date.fields = <string> single

See Also

read.dcf

Examples

packageDescription("stats")
packageDescription("stats", fields = c("Package", "Version"))

packageDescription("stats", fields = "Version")
packageDescription("stats", fields = "Version", drop = FALSE)

if(packageVersion("MASS") < "7.3.29")
  message("you need to update 'MASS'")

pu <- packageDate("utils")
str(pu)
stopifnot(identical(pu, packageDate(desc = packageDescription("utils"))),
          identical(pu, packageDate("stats"))) # as "utils" and "stats" are
                                   # both 'base R' and "Built" at same time

utils

adist: Approximate String Distances alarm: Alert the User apropos: Find Objects by (Partial) Name aregexec: Approximate String Match Positions arrangeWindows: Rearrange Windows on MS Windows askYesNo: Ask a Yes/No Question aspell: Spell Check Interface aspell-utils: Spell Check Utilities available.packages: List Available Packages at CRAN-like Repositories BATCH: Batch Execution of R bibentry: Bibliography Entries browseEnv: Browse Objects in Environment browseURL: Load URL into an HTML Browser browseVignettes: List Vignettes in an HTML Browser bug.report: Send a Bug Report capture.output: Send Output to a Character String or File changedFiles: Detect which Files Have Changed charClass: Character Classification chooseBioCmirror: Select a Bioconductor Mirror chooseCRANmirror: Select a CRAN Mirror choose.dir: Choose a Folder Interactively on MS Windows choose.files: Choose a List of Files Interactively on MS Windows citation: Citing R and R Packages in Publications cite: Cite a Bibliography Entry citEntry: Bibliography Entries (Older Interface) clipboard: Read/Write to/from the Clipboard in MS Windows close.socket: Close a Socket combn: Generate All Combinations of n Elements, Taken m at a Time compareVersion: Compare Two Package Version Numbers COMPILE: Compile Files for Use with R on Unix-alikes contrib.url: Find Appropriate Paths in CRAN-like Repositories count.fields: Count the Number of Fields per Line create.post: Ancillary Function for Preparing Emails and Postings data: Data Sets dataentry: Spreadsheet Interface for Entering Data debugcall: Debug a Call debugger: Post-Mortem Debugging demo: Demonstrations of R Functionality DLL.version: DLL Version Information on MS Windows download.file: Download File from the Internet download.packages: Download Packages from CRAN-like Repositories edit: Invoke a Text Editor edit.data.frame: Edit Data Frames and Matrices example: Run an Examples Section from the Online Help file.edit: Edit One or More Files filetest: Shell-style Tests on Files findLineNum: Find the Location of a Line of Source Code, or Set a... fix: Fix an Object flush.console: Flush Output to a Console format: Format Unordered and Ordered Lists getAnywhere: Retrieve an R Object, Including from a Namespace getFromNamespace: Utility Functions for Developing Namespaces getParseData: Get Detailed Parse Information from Object getS3method: Get an S3 Method getWindowsHandle: Get a Windows Handle getWindowsHandles: Get handles of Windows in the MS Windows RGui glob2rx: Change Wildcard or Globbing Pattern into Regular Expression globalVariables: Declarations Used in Checking a Package hasName: Check for Name head: Return the First or Last Parts of an Object help: Documentation help.request: Send a Post to R-help help.search: Search the Help System help.start: Hypertext Documentation hsearch-utils: Help Search Utilities INSTALL: Install Add-on Packages installed.packages: Find Installed Packages install.packages: Install Packages from Repositories or Local Files isS3method: Is 'method' the Name of an S3 Method? isS3stdGen: Check if a Function Acts as an S3 Generic LINK: Create Executable Programs on Unix-alikes localeToCharset: Select a Suitable Encoding Name from a Locale Name ls_str: List Objects and their Structure maintainer: Show Package Maintainer make.packages.html: Update HTML Package List make.socket: Create a Socket Connection memory.size: Report on Memory Allocation (on Windows) menu: Menu Interaction Function methods: List Methods for S3 Generic Functions or Classes mirrorAdmin: Managing Repository Mirrors modifyList: Recursively Modify Elements of a List news: Build and Query R or Package News Information nsl: Look up the IP Address by Hostname (on Unix-alikes) object.size: Report the Space Allocated for an Object packageDescription: Package Description packageName: Find Package Associated with an Environment package.skeleton: Create a Skeleton for a New Source Package packageStatus: Package Management Tools page: Invoke a Pager on an R Object person: Persons PkgUtils: Utilities for Building and Checking Add-on Packages process.events: Trigger Event Handling prompt: Produce Prototype of an R Documentation File promptData: Generate Outline Documentation for a Data Set promptPackage: Generate a Shell for Documentation of a Package Question: Documentation Shortcuts rcompgen: A Completion Generator for R Rconsole: R for Windows Configuration read.DIF: Data Input from Spreadsheet read.fortran: Read Fixed-Format Data in a Fortran-like Style read.fwf: Read Fixed Width Format Files readRegistry: Read a Windows Registry Hive read.socket: Read from or Write to a Socket read.table: Data Input recover: Browsing after an Error relist: Allow Re-Listing an unlist()ed Object REMOVE: Remove Add-on Packages remove.packages: Remove Installed Packages removeSource: Remove Stored Source from a Function or Language Object RHOME: R Home Directory roman: Roman Numerals Rprof: Enable Profiling of R's Execution Rprofmem: Enable Profiling of R's Memory Use Rscript: Scripting Front-End for R RShowDoc: Show R Manuals and Other Documentation RSiteSearch: Search for Key Words or Phrases in Documentation rtags: An Etags-like Tagging Utility for R Rtangle: R Driver for Stangle RweaveLatex: R/LaTeX Driver for Sweave savehistory: Load or Save or Display the Commands History select.list: Select Items from a List sessionInfo: Collect Information About the Current R Session setRepositories: Select Package Repositories setWindowTitle: Set the Window Title or the Statusbar of the RGui in Windows SHLIB: Build Shared Object/DLL for Dynamic Loading shortPathName: Express File Paths in Short Form on Windows sourceutils: Source Reference Utilities stack: Stack or Unstack Vectors from a Data Frame or List str: Compactly Display the Structure of an Arbitrary R Object strcapture: Capture String Tokens into a data.frame summaryRprof: Summarise Output of R Sampling Profiler Sweave: Automatic Generation of Reports SweaveSyntConv: Convert Sweave Syntax SweaveUtils: Sweave Driver Utilities tar: Create a Tar Archive toLatex: Converting R Objects to BibTeX or LaTeX txtProgressBar: Text Progress Bar type.convert: Convert Data to Appropriate Type untar: Extract or List Tar Archives unzip: Extract or List Zip Archives update.packages: Compare Installed Packages with CRAN-like Repositories URLencode: Encode or Decode (partial) URLs url.show: Display a Text URL utils-defunct: Defunct Functions in Package 'utils' utils-deprecated: Deprecated Functions in Package 'utils' utils-package: The R Utils Package View: Invoke a Data Viewer vignette: View, List or Get R Source of Package Vignettes warnErrList: Collect and Summarize Errors From List winDialog: Dialog Boxes under Windows winextras: Get Windows Version winMenus: User Menus under MS Windows (Rgui) winProgressBar: Progress Bars under MS Windows write.table: Data Output zip: Create Zip Archives
What can we improve?
Extra info (optional)

R Package Documentation

rdrr.io home R language documentation Run R code online

Browse R Packages

CRAN packages Bioconductor packages R-Forge packages GitHub packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.
Tweet to @rdrrHQ
GitHub issue tracker
[email protected]
Personal blog

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.

Close
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.