MyNixOS website logo
Description

Compute the Difference Between Data Frames.

Shows you which rows have changed between two data frames with the same column structure. Useful for diffing slowly mutating data.

diffdfs

A small R package to compute the difference between data frames.

Install

It's not on CRAN, so install via devtools.

devtools::install_github("riazarbi/diffdfs")

Use

This package just has two functions, checkkey and diffdfs.

checkkey is just a helper for diffdfs but you can use it if it suits your purposes.

here are some examples you can run in your R session:

library(diffdfs)
iris$key <- 1:nrow(iris)

old_df <- iris[1:100,]
old_df[75,1] <- 100
new_df <- iris[50:150,]
> diffdfs(new_df, old_df, key_cols = "key")
    operation Sepal.Length Sepal.Width Petal.Length Petal.Width    Species key
1         new          6.3         3.3          6.0         2.5  virginica 101
2         new          5.8         2.7          5.1         1.9  virginica 102
3         new          7.1         3.0          5.9         2.1  virginica 103
4         new          6.3         2.9          5.6         1.8  virginica 104
5         new          6.5         3.0          5.8         2.2  virginica 105
6         new          7.6         3.0          6.6         2.1  virginica 106
...
...
irisint = iris
irisint$rownum = 1:nrow(irisint)
key_cols = c("rownum")
> checkkey(irisint, key_cols, TRUE)
Checking that key column rows are unique
[1] TRUE
> checkkey(irisint, "Species", TRUE)
Checking that key column rows are unique
[1] FALSE

Contributing

Riaz Arbi is the maintainer of this package. If you'd like to point out a bug or make a suggestion, create an issue in this repo.

Metadata

Version

0.9.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows