format.pkgaudit() renders the scan metadata and finding counts as a
character vector of lines; print.pkgaudit() writes those lines and returns
the object invisibly.
See also
summary.pkgaudit() for a sectioned report of the findings
themselves rather than their counts.
Examples
# untrustedpkg is a small package shipped with pkgaudit to be scanned.
tarball <- system.file(
"extdata", "untrustedpkg", "untrustedpkg_0.1.0.tar.gz",
package = "pkgaudit"
)
result <- audit_tarball(tarball)
print(result)
#> --- pkgaudit ----------------------------------------------------------------
#> Package: untrustedpkg v0.1.0 (source tarball)
#> Path: ~/work/_temp/Library/pkgaudit/extdata/untrustedpkg/untrustedpkg_0.1.0.tar.gz
#> SHA-256: 0c58ddcb365787ab7401c5eedaa4be7eb4ce6bea0a5ca290b6b7b1d8eb621d44
#> Scanned: 2026-08-27 01:19 UTC with pkgaudit v0.4.0, rules v0.4.0
#>
#> File contexts: 1
#> Patterns: 4
#> Matches: 1
#> Errors: 0
print(result, path = FALSE) # omit the local Path: line for sharing
#> --- pkgaudit ----------------------------------------------------------------
#> Package: untrustedpkg v0.1.0 (source tarball)
#> SHA-256: 0c58ddcb365787ab7401c5eedaa4be7eb4ce6bea0a5ca290b6b7b1d8eb621d44
#> Scanned: 2026-08-27 01:19 UTC with pkgaudit v0.4.0, rules v0.4.0
#>
#> File contexts: 1
#> Patterns: 4
#> Matches: 1
#> Errors: 0