Description Usage Arguments Examples
Patching related methods.
Generate a patch for two atomic objects that are close in values.
This patch will use another patch to record changes to attributes (if any). Otherwise, given indices of changed object, it will generate a patch over those indices.
Assume two objects are identical and only patch their attributes.
1 2 3 4 5 6 7 8 9 10 11 | as.patch(x)
identity_patch()
trivial_patch(object)
atomic_differences_patch(old_object, new_object, transition = TRUE)
differences_patch(old_object, new_object, differences)
attributes_patch(old_object, new_object)
|
x |
function. Apply |
object |
ANY. An R object that will be returned by the
function created from |
old_object |
atomic. |
new_object |
atomic. |
transition |
logical. Whether or not to use a transition depending
on how many element do not match. Namely, if over 50
from a random sample of 100 elements (so most of |
differences |
logical or integer. The differences in first and second object.
These should be calculated externally because a different approach
could be used for different objects (e.g., lists versus atomic;
in the former we would need |
1 2 3 | x <- 1:10; y <- x; y[1] <- 5
patch <- objectdiff:::atomic_differences_patch(x, y)
stopifnot(identical(y, patch(x)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.