Diff a Package Function (or Every Function) Across Installed Versions
Source:R/diff_versions.R
diff_versions.RdCompare the deparsed source of package functions across two already
installed versions of the same package. With name set, compares exactly
one function. With name = NULL (the default), compares every function
in scope at once, using a single extraction subprocess per version
rather than one per function.
Arguments
- package
A single installed package name.
- name
A single function name, exported or internal, or
NULL(the default) to diff every function inscopeinstead.- v1, v2
Single version strings to compare.
- lib
Character vector of library paths to search. Defaults to
.libPaths().- timeout
Maximum number of seconds allowed for each extraction subprocess. Must be finite and positive.
- scope
Only used when
nameisNULL."exported"(the default) diffs only exported functions;"all"also includes internal (non-exported) functions.- store
An optional
insider_storehandle (seeinsider_store()). When supplied, the returnedinsider_difforinsider_diff_packageobject is also recorded in the store viastore_save(); the resulting id is attached as its"store_id"attribute. The default,NULL, records nothing, consistent with the store's explicit, opt-in design.- store_label
An optional label passed through to
store_save()whenstoreis supplied.Optional character tags passed through to
store_save()whenstoreis supplied.
Value
Invisibly: when name is given, an insider_diff object
containing the resolved library paths for each version, whether the
sources are byte-identical, added and removed line counts, argument-name
changes, the ordered line diff, and the original deparsed source for
each version. When name is NULL, an insider_diff_package object
containing a per-function summary data frame (name, status
added/removed/changed/identical, exported flags, line-diff
counts, whether formals changed) plus diffs, a named list of the same
per-function insider_diff objects the single-function form returns, so
x$diffs[["some_fn"]] can be inspected or printed directly.