mergeFork {crunch} | R Documentation |
Merge changes to a dataset from a fork
Description
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.
Usage
mergeFork(dataset, fork, autorollback = TRUE, force = FALSE)
Arguments
dataset |
The |
fork |
The |
autorollback |
logical If the merge fails, should |
force |
logical Attempt to push through merge conflicts by dropping all
changes to |
Details
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")
.
Value
dataset
with changes from fork
merged to it.
See Also
Examples
## 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)