Patch data with a diff generated by diff_data

patch_data(data, patch)

Arguments

data

data.frame that should be patched

patch

generated with diff_data

Value

data.frame that has been patched.

Examples

library(daff)
x <- iris
#change a value
x[1,1] <- 1000

patch <- diff_data(iris, x)
print(patch)
#> Daff Comparison: ‘iris’ vs. ‘x’ 
#>     Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> ->  5.1->1000    3.5         1.4          0.2         setosa 
#>     4.9          3           1.4          0.2         setosa 
#> ... ...          ...         ...          ...         ...    
#> 
# apply patch
iris_patched <- patch_data(iris, patch)

iris_patched[1,1] == 1000
#> [1] TRUE