Package 'packageDiff'

Title: Compare R Package Differences
Description: It provides utility functions for investigating changes within R packages. The pkgInfo() function extracts package information such as exported and non-exported functions as well as their arguments. The pkgDiff() function compares this information for two versions of a package and creates a diff file viewable in a browser.
Authors: Cole Beck [aut, cre]
Maintainer: Cole Beck <[email protected]>
License: GPL (>= 2)
Version: 0.2
Built: 2025-03-12 03:28:53 UTC
Source: https://github.com/couthcommander/packagediff

Help Index


Package Diff

Description

It provides utility functions for investigating changes within R packages. The pkgInfo function extracts package information such as exported and non-exported functions as well as their arguments. The pkgDiff function compares this information for two versions of a package and creates a diff file viewable in a browser.

Details

This package is experimental. Please submit bugs to https://github.com/couthcommander/packageDiff.

Author(s)

Cole Beck [email protected]

Maintainer: Cole Beck [email protected]

See Also

Useful links:

Examples

tar1 <- system.file("examples", "yaml_2.1.18.tar.gz", package = "packageDiff")
tar2 <- system.file("examples", "yaml_2.1.19.tar.gz", package = "packageDiff")
a <- pkgInfo(tar1)
b <- pkgInfo(tar2)
pkgDiff(a, b)

a <- pkgInfo('https://cran.r-project.org/src/contrib/Archive/yaml/yaml_2.1.18.tar.gz')
b <- pkgInfo('https://cran.r-project.org/src/contrib/Archive/yaml/yaml_2.1.19.tar.gz')
pkgDiff(a, b)

Package Diff

Description

This function compares version changes within packages.

Usage

pkgDiff(a, b, doc = TRUE, src = TRUE, vignettes = TRUE,
  tests = TRUE, demo = TRUE, width = 80)

Arguments

a

First package, a ‘pkgInfo’ object.

b

Second package, a ‘pkgInfo’ object.

doc

Include documentation in diff output.

src

Include src files in diff output

vignettes

Include vignette files in diff output

tests

Include test files in diff output

demo

Include demo files in diff output

width

Output width.

Details

Generate diffs between package information.

Value

‘diffr’ object is open in browser

Examples

tar1 <- system.file("examples", "yaml_2.1.18.tar.gz", package = "packageDiff")
tar2 <- system.file("examples", "yaml_2.1.19.tar.gz", package = "packageDiff")
a <- pkgInfo(tar1)
b <- pkgInfo(tar2)
pkgDiff(a, b)

Extract Package Information

Description

This function extracts information from an R package.

Usage

pkgInfo(pkg, leaveRemains = FALSE)

Arguments

pkg

The compressed (tar.gz) build file of an R package.

leaveRemains

Keep decompressed package in temp directory.

Details

Generate package information from its build file.

Value

Package

Package name

Version

Version number

Imports

Imported packages

Suggests

Suggested packages

ImportedFunctions

Functions imported from other packages

ExportedFunctions

Functions exported from package

AllFunctions

All defined functions

FormalArgs

Function arguments

Data

Dimension information on data sets

documentation

Full package documentation

source

Files in src directory

vignettes

Files in vignettes directory

tests

Files in tests directory

demo

Files in demo directory

Examples

tarfile <- system.file("examples", "acepack_1.3-3.3.tar.gz", package = "packageDiff")
info <- pkgInfo(tarfile)

url <- 'https://cran.r-project.org/src/contrib/Archive/acepack/acepack_1.3-3.3.tar.gz'
info <- pkgInfo(url)

Print Package Information

Description

Print method for ‘packageInfo’ class.

Usage

## S3 method for class 'pkgInfo'
print(x, doc = FALSE, src = FALSE,
  vignettes = FALSE, tests = FALSE, demo = FALSE, ...)

Arguments

x

A packageInfo object.

doc

Include documentation in output.

src

Include src files in output.

vignettes

Include vignette files in output.

tests

Include test files in output.

demo

Include demo files in output.

...

Additional parameters, unused at this time.

Details

Print its argument and return it invisibly.

Examples

tarfile <- system.file("examples", "acepack_1.3-3.3.tar.gz", package = "packageDiff")
pkgInfo(tarfile)

url <- 'https://cran.r-project.org/src/contrib/Archive/acepack/acepack_1.3-3.3.tar.gz'
info <- pkgInfo(url)
print(info)

Extract R Package

Description

Untar an R package into a temp directory.

Usage

unzipPackage(x)

Arguments

x

The compressed (tar.gz) build file of an R package, either local or URL.

Value

List of files extracted.

Examples

tarfile <- system.file("examples", "acepack_1.3-3.3.tar.gz", package = "packageDiff")
info <- unzipPackage(tarfile)