mergeFork {crunch}R Documentation

Merge changes to a dataset from a fork


Crunch datasets include information about the dataset's revision history. This function takes the changes made on a dataset fork and adds them to the revision history of the parent dataset, like a merge of branches in a version control system.


mergeFork(dataset, fork, autorollback = TRUE, force = FALSE)



The CrunchDataset to merge to


The CrunchDataset, which must be a fork from dataset, that is to be merged in.


logical If the merge fails, should dataset be restored to its state prior to the merge, or should it be left in its partially merged state for debugging and manual fixing? Default is TRUE.


logical Attempt to push through merge conflicts by dropping all changes to dataset that occurred after fork diverged from and take only the changes from fork? Default is FALSE. You should only use force=TRUE after first attempting and failing to merge without forcing.


All modifications of a dataset record actions in its revision history. For example, if you add a variable to the dataset, that action is recorded. The sum of these records is a dataset's revision history, and it is possible to merge in the revision history of a dataset that has been forked.

This function is most often used in conjunction with forkDataset() to create a copy of a dataset, make some changes to that copy, and then merge the changes back into the original dataset. For more on this workflow, see vignette("fork-and-merge", package = "crunch").


dataset with changes from fork merged to it.

See Also



## Not run: 
ds <- loadDataset("My survey")
fork <- forkDataset(ds)
# Do stuff to fork
ds <- mergeFork(ds, fork)
# Now the changes you did to fork are also on ds

## End(Not run)

[Package crunch version 1.30.1 Index]