compare_spacks: Compare source packages eg for checking git

compare_spacksR Documentation

Compare source packages eg for checking git

Description

Suppose you have a maintained task-package, and you've made a source package from it. And that there's a version on github, which you want to update. So you pull it, into your local github spot, then check for any changes with this function. If there aren't any, then you don't need to mess around with unpackage; you could carry on maintaining your task-package as usual, then scrunge it into your github spot, then push.

compare_spack_code actually looks for functions in "mypack.R" file that differ between the versions. It tries to look at attributes of the functions, too (usually there won't be any). If you ask for one specific function only, it will try to use the diffr package to display a nice diff of the two versions.

Probably I should describe what to do if you do find a difference... haven't needed to yet!

Usage

compare_spacks(pkg, gitplace = "d:/github/flub",
    d1, d2, character.only = FALSE)
compare_spack_code(pkg, gitplace = "d:/github/flub",
    d1, d2, character.only = FALSE, showdiff=NULL)

Arguments

pkg

as per build.pkg etc; eg mypack or ..mypack

gitplace

your local github spot

d1, d2

Or you can specify the folders directly with these (need to set both)

character.only

as per build.pkg etc, eg char="mypack" (or more likely char=thispack when thispack is the index of a for-loop)

showdiff

optional, name of one function to show differences for.

Value

A list with character-vector components in1, in2, and diffs (unless showdiff is set). Any file (or any function, for compare_spack_code) which are not different won't be mentioned. If showdiff is set, nothing is returned, but you should see the results in your browser.


mvbutils documentation built on May 25, 2026, 5:09 p.m.