Description Usage Arguments Author(s) See Also Examples
Compare two data.frames and report any differences between them,
much like SAS's PROC COMPARE
procedure.
1 2 3 4 |
x, y |
A data.frame to compare |
by, by.x, by.y |
Which variables are IDs to merge the two data.frames?
If set to |
control |
A list of control parameters from |
... |
Other arguments, passed to |
Ethan Heinzen, adapted from code from Andrew Hanson
summary.comparedf
, comparedf.control
,
diffs
, n.diffs
, n.diff.obs
1 2 3 4 5 6 7 8 9 | df1 <- data.frame(id = paste0("person", 1:3), a = c("a", "b", "c"),
b = c(1, 3, 4), c = c("f", "e", "d"),
row.names = paste0("rn", 1:3), stringsAsFactors = FALSE)
df2 <- data.frame(id = paste0("person", 3:1), a = c("c", "b", "a"),
b = c(1, 3, 4), d = paste0("rn", 1:3),
row.names = paste0("rn", c(1,3,2)), stringsAsFactors = FALSE)
summary(comparedf(df1, df2))
summary(comparedf(df1, df2, by = "id"))
summary(comparedf(df1, df2, by = "row.names"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.