R compare.data.frame差异不显示值

时间:2018-07-17 17:41:29

标签: r compare

我正在使用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.xvalues.y列显示<S3: AsIs>而不是显示值。为什么会这样呢?有办法解决吗?

0 个答案:

没有答案