r-lib / diffviewer

HTML widget to visually compare files
http://diffviewer.r-lib.org
Other
58 stars 7 forks source link

Also compare dataframes? #17

Closed gorkang closed 10 months ago

gorkang commented 2 years ago

It would be nice if diffviewer allowed to also compare dataframes.

For my own use, I created the small helper function below that creates tempfiles from the dataframes to be able to use diffviewer:

compare_DFs <- function(DF_new, DF_old) {

  OLD = tempfile(pattern = "OLD_", fileext = ".csv")
  NEW = tempfile(pattern = "NEW_", fileext = ".csv")

  readr::write_csv(DF_old, OLD)
  readr::write_csv(DF_new, NEW)

diffviewer::visual_diff(OLD, NEW)

}
hadley commented 10 months ago

Thanks for filing this issue! Unfortunately, I think it's out of scope for this package: developing good software requires relentless focus, which means that we have to say no to many good ideas. Even though I'm closing this issue, I really appreciate the feedback, and hope you'll continue to contribute in the future 😄