Skip to content

Instantly share code, notes, and snippets.

@brodieG
Last active November 18, 2016 02:27
Show Gist options
  • Save brodieG/b6b2f048fd3d086ff23c015eb3027a8e to your computer and use it in GitHub Desktop.
Save brodieG/b6b2f048fd3d086ff23c015eb3027a8e to your computer and use it in GitHub Desktop.
Compare diffobj vs. all.equal with nested list
list.A <- list(
list(a=1, b=2, c=matrix(1:9, 3)),
letters[1:16],
1:100,
head(warpbreaks, 3)
)
list.B <- list.A
list.B[[1]]$a <- list()
list.B[[1]]$c <- list.B[[1]]$c[-1, ]
list.B[[2]] <- LETTERS[1:16]
list.B[[4]] <- head(warpbreaks, 3)[-2]
all.equal(list.A, list.B)
diffPrint(list.A, list.B)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment