View source: R/compare_observations.R
| compare_observations | R Documentation |
Performs row-by-row comparison of two datasets on common columns, identifying specific value differences at the cell level. Returns discrepancy counts and details showing which rows differ and how their values diverge.
compare_observations(df1, df2, tolerance = 0)
df1 |
A data frame representing the first dataset. |
df2 |
A data frame representing the second dataset. |
tolerance |
Numeric tolerance value for floating-point comparisons (default 0). When tolerance > 0, numeric values are considered equal if their absolute difference is within the tolerance threshold. Character and factor columns always use exact matching regardless of tolerance. |
A list containing discrepancy counts and details of row differences.
df1 <- data.frame(id = 1:3, value = c(1.0, 2.0, 3.0))
df2 <- data.frame(id = 1:3, value = c(1.0, 2.5, 3.0))
compare_observations(df1, df2)
compare_observations(df1, df2, tolerance = 0.00001)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.