Dataframe Difference Tool

Functions for comparing two data.frames against each other. The core functionality is to provide a detailed breakdown of any differences between two data.frames as well as providing utility functions to help narrow down the source of problems and differences.


diffdf

CRAN_Status_Badge Downloads Code Coverage 📔

diffdf compares two data.frame objects and provides a detailed summary of any differences that were found between them. The package has it's origins in supporting QC workflows for product development within the pharmaceutical industry aiming at being a light weight alternative to SAS's PROC COMPARE.

Currently diffdf supports the following:

  • Checking for differences in:
    • Values
    • Attributes
    • Classes
    • Column names
    • Number of observations
    • Column ordering
  • Matching rows by key/id variables
  • Fuzzy comparisons (i.e. treating doubles and integers as the same)
  • Extracting datasets of different rows

For more information on features please consult the vignette and man pages.

Alternatives

If diffdf isn't quite right for your use case then the following are other packages that provide similar functionality that may be more appropriate:

Installation

You can install the released version of diffdf from CRAN with:

install.packages("diffdf")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("gowerc/diffdf")

Example

library(diffdf)
iris2 <- iris
for (i in 1:3) iris2[i,i] <- i^2
iris2$new_var <- "hello"
class(iris2$Species) <- "some class"
diffdf(iris, iris2)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.