All Projects → edwindj → Daff

edwindj / Daff

Licence: other
Diff, patch and merge for data.frames, see http://paulfitz.github.io/daff/

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Daff

Editscript
A library designed to diff and patch Clojure data structures
Stars: ✭ 281 (+132.23%)
Mutual labels:  data, diff
Phoenix Diff
See the changes needed when upgrading an Elixir Phoenix application
Stars: ✭ 120 (-0.83%)
Mutual labels:  diff
Node Rus Diff
JSON diff
Stars: ✭ 112 (-7.44%)
Mutual labels:  diff
Js Adler32
☑️ ADLER-32 checksum
Stars: ✭ 116 (-4.13%)
Mutual labels:  data
Patentcrawler
scrapy专利爬虫(停止维护)
Stars: ✭ 114 (-5.79%)
Mutual labels:  data
Csv Diff
Python CLI tool and library for diffing CSV and JSON files
Stars: ✭ 118 (-2.48%)
Mutual labels:  diff
Jardiff
A tool for comparing JAR files, including Scala pickled signatures and method code
Stars: ✭ 112 (-7.44%)
Mutual labels:  diff
Kiba
Data processing & ETL framework for Ruby
Stars: ✭ 1,618 (+1237.19%)
Mutual labels:  data
Apkdiffpatch
a C++ library and command-line tools for Zip(Jar,Apk) file Diff & Patch; create minimal delta/differential; support Jar sign(apk v1 sign) & apk v2,v3 sign .
Stars: ✭ 121 (+0%)
Mutual labels:  diff
Gray Matter
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Stars: ✭ 2,105 (+1639.67%)
Mutual labels:  data
Chartjs Plugin Dragdata
Draggable data points plugin for Chart.js
Stars: ✭ 116 (-4.13%)
Mutual labels:  data
Just Dashboard
📊 📋 Dashboards using YAML or JSON files
Stars: ✭ 1,511 (+1148.76%)
Mutual labels:  data
Shinny Futures Android
一个开源的 android 平台期货行情交易终端
Stars: ✭ 120 (-0.83%)
Mutual labels:  diff
Rgbif
Interface to the Global Biodiversity Information Facility API
Stars: ✭ 113 (-6.61%)
Mutual labels:  data
Awesome Opendata Rus
Opendata resources in Russian / Открытые данные на русском языке
Stars: ✭ 121 (+0%)
Mutual labels:  data
Repurrrsive
Recursive lists to use in teaching and examples, because there is no iris data for lists.
Stars: ✭ 112 (-7.44%)
Mutual labels:  data
Geo Data Viewer
🗺️ Geo Data Viewer w/0 Py 🐍 || pyWidgets ⚙️ || pandas 🐼 || @reactjs ⚛️ required to gen. some snazzy maps 🗺️ with keplerGL ...
Stars: ✭ 115 (-4.96%)
Mutual labels:  data
Hearthstone Db
A JSON collection of all Hearthstone cards. Hearthstone database.
Stars: ✭ 117 (-3.31%)
Mutual labels:  data
Micro Jaymock
Tiny API mocking microservice for generating fake JSON data.
Stars: ✭ 123 (+1.65%)
Mutual labels:  data
Data Store
Easily get, set and persist config data. Fast. Supports dot-notation in keys. No dependencies.
Stars: ✭ 120 (-0.83%)
Mutual labels:  data

Daff: diff, patch and merge for data.frames

daff is an R package that can find difference in values between data.frames, store this difference, render it and apply this difference to patch a data.frame. It can also merge two versions of a data.frame having a common parent. It wraps the daff.js library using the V8 package.

The diff format is described in https://paulfitz.github.io/daff-doc/spec.html.

version downloads Build Status AppVeyor Build Status

Working:

  • diff: diff_data
  • patch: patch_data
  • write/read diff: read_diff and write_diff
  • render to html: render_diff
  • merge two tables based on a same version: merge_data

TODO:

  • add htmlwidgets
  • implement extra parameters for diff_data: ids, ignore etc.
  • make column type changes explicit (is now internally available)
  • see if daff can be implemented in C++, using the Haxe C++ target of daff: this would remove the V8/jsonlite dependency

Install

Install from CRAN

install.packages('daff')

The latest version of daff can be installed with devtools

devtools::install_github("edwindj/daff")

Usage

diff_data

Calculate the difference between a reference and a changed data.frame

library(daff)
y <- iris[1:3,]
x <- y

x <- head(x,2) # remove a row
x[1,1] <- 10 # change a value
x$hello <- "world"  # add a column
x$Species <- NULL # remove a column

patch <- diff_data(y, x)

# write a patch to disk
write_diff(patch, "patch.csv")

render_diff(patch) will generate the following HTML page:

render_diff

patch_data

Patch a data.frame using a diff generated with diff_data.

# read a diff from disk
patch <- read_diff("patch.csv")

# apply patch
y_patched <- patch_data(y, patch)

merge_data

Merge two data.frames that have diverged from a common parent data.frame.

parent <- a <- b <- iris[1:3,]
a[1,1] <- 10
b[2,1] <- 11
# succesful merge
merge_data(parent, a, b)

parent <- a <- b <- iris[1:3,]
a[1,1] <- 10
b[1,1] <- 11
# conflicting merge (both a and b change same cell)
merged <- merge_data(parent, a, b)
merged #note the conflict

#find out which rows contain a conflict
which_conflicts(merged)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].