Jun Shen wrote:
Hi, David,
Thanks for the reply. However str() doesn't tell me exactly which element is
different. I expect to see a is identical to b. But if there is some minor
difference (usually by human mistake), I want to know which element
(numerical or character) is different.
So you're saying you have two data.frames with the same dimensions and want to
know which elements are different? What about different attributes such as
names, labels, etc?
A very naive first attempt might be something like:
df1 <- data.frame(a = 1:10, b = 2:11)
df2 <- data.frame(a = 1:10, b = c(2:10, 12))
mapply("==", df1, df2)
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.