dat1 <- mtcars
dat2 <- mtcars
attr(dat2, "description") <- "# MTCARS\nData description ..."
all.equal(dat1, dat2) ## not TRUE
Returns:
[1] "Attributes: < Names: 1 string mismatch >"
[2] "Attributes: < Length mismatch: comparison on first 2 components >"
[3] "Attributes: < Component 2: Lengths (32, 1) differ (string compare on first 1) >"
[4] "Attributes: < Component 2: 1 string mismatch >"
dat1 <- tibble::as_tibble(mtcars)
dat2 <- tibble::as_tibble(mtcars)
attr(dat2, "description") <- "# MTCARS\nData description ..."
all.equal(dat1, dat2) ## TRUE, ignores attribute
dplyr::all_equal(dat1, dat2) ## TRUE, ignores attribute
Both base::all.equal and dplyr::all_equal return TRUE here. Is this expected? Checked using both 1.3.4 and 1.4.1 on macOS Sierra