return which rows of a merged data.frame contain conflicts.

which_conflicts(merged)

Arguments

merged

data.frame merged data.frame with possible conflicts.

Value

integer vector with row positions containing conflicts.

See also

Examples

parent <- a <- b <- iris[1:3,]
a[1,1] <- 10
b[2,1] <- 11
# succesful merge
merge_data(parent, a, b)
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1         10.0         3.5          1.4         0.2  setosa
#> 2         11.0         3.0          1.4         0.2  setosa
#> 3          4.7         3.2          1.3         0.2  setosa

parent <- a <- b <- iris[1:3,]
a[1,1] <- 10
b[1,1] <- 11
# conflicting merge (both a and b change same cell)
merged <- merge_data(parent, a, b)
#> Warning: 
#> 	1 conflict(s) detected!
#> 	Conflicting values are noted with '(((parent))) a /// b'.
#> 	Use 'which_conflict' to find out which rows contain conflicting values.
merged #note the conflict
#>            Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 ((( 5.1 ))) 10 /// 11         3.5          1.4         0.2  setosa
#> 2                   4.9         3.0          1.4         0.2  setosa
#> 3                   4.7         3.2          1.3         0.2  setosa

#find out which rows contain a conflict
which_conflicts(merged)
#> [1] 1