diffviewer icon indicating copy to clipboard operation
diffviewer copied to clipboard

Also compare dataframes?

Open gorkang opened this issue 2 years ago • 0 comments

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)

}

gorkang avatar Jan 15 '22 07:01 gorkang