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 |
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.
This package is experimental. Please submit bugs to https://github.com/couthcommander/packageDiff.
Cole Beck [email protected]
Maintainer: Cole Beck [email protected]
Useful links:
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)
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)
This function compares version changes within packages.
pkgDiff(a, b, doc = TRUE, src = TRUE, vignettes = TRUE, tests = TRUE, demo = TRUE, width = 80)
pkgDiff(a, b, doc = TRUE, src = TRUE, vignettes = TRUE, tests = TRUE, demo = TRUE, width = 80)
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. |
Generate diffs between package information.
‘diffr’ object is open in browser
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)
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)
This function extracts information from an R package.
pkgInfo(pkg, leaveRemains = FALSE)
pkgInfo(pkg, leaveRemains = FALSE)
pkg |
The compressed (tar.gz) build file of an R package. |
leaveRemains |
Keep decompressed package in temp directory. |
Generate package information from its build file.
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 |
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)
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 method for ‘packageInfo’ class.
## S3 method for class 'pkgInfo' print(x, doc = FALSE, src = FALSE, vignettes = FALSE, tests = FALSE, demo = FALSE, ...)
## S3 method for class 'pkgInfo' print(x, doc = FALSE, src = FALSE, vignettes = FALSE, tests = FALSE, demo = FALSE, ...)
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. |
Print its argument and return it invisibly.
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)
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)
Untar an R package into a temp directory.
unzipPackage(x)
unzipPackage(x)
x |
The compressed (tar.gz) build file of an R package, either local or URL. |
List of files extracted.
tarfile <- system.file("examples", "acepack_1.3-3.3.tar.gz", package = "packageDiff") info <- unzipPackage(tarfile)
tarfile <- system.file("examples", "acepack_1.3-3.3.tar.gz", package = "packageDiff") info <- unzipPackage(tarfile)