我正在使用compare.data.frame function提取两个df之间的差异。
请参见以下示例:
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)
comp <- compare(df1, df2)
diffs(comp)
但是,输出中的values.x
和values.y
列显示<S3: AsIs>
而不是显示值。为什么会这样呢?有办法解决吗?