daff

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

https://github.com/edwindj/daff

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary

Keywords

daff data diff r

Keywords from Contributors

tidy-data csv fwf parsing
Last synced: 6 months ago · JSON representation

Repository

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

Basic Info
Statistics
  • Stars: 156
  • Watchers: 10
  • Forks: 18
  • Open Issues: 12
  • Releases: 0
Topics
daff data diff r
Created about 11 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```



![version](http://www.r-pkg.org/badges/version/daff)
[![R-CMD-check](https://github.com/edwindj/daff/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/edwindj/daff/actions/workflows/R-CMD-check.yaml)
![downloads](http://cranlogs.r-pkg.org/badges/daff)



# 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](http://paulfitz.github.io/daff/) library using the
[V8](https://github.com/jeroen/v8) package.

The diff format is described in
.


Functions:

- 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`


## Installation

You can install the development version of daff from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("edwindj/daff")
```

# Usage

## diff_data

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

``` r
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`. ``` r # read a diff from disk patch <- read_diff("patch.csv") # apply patch y_patched <- patch_data(y, patch) ``` ## merge_data Merge two `data.frame`s that have diverged from a common parent `data.frame`. ``` r 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) ```

Owner

  • Name: Edwin de Jonge
  • Login: edwindj
  • Kind: user
  • Location: @edwindjonge
  • Company: Statistics Netherlands (CBS)

ORCID: 0000-0002-6580-4718

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 195
  • Total Committers: 5
  • Avg Commits per committer: 39.0
  • Development Distribution Score (DDS): 0.451
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Edwin de Jonge e****e@g****m 107
Gregory R. Warnes g****s@m****m 76
Gregory R. Warnes g****g@w****t 8
Jeroen Ooms j****s@g****m 3
Salim B s****m@p****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 26
  • Total pull requests: 12
  • Average time to close issues: 4 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 22
  • Total pull request authors: 6
  • Average comments per issue: 2.58
  • Average comments per pull request: 0.83
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • edwindj (3)
  • eusebe (2)
  • markvanderloo (2)
  • rajesh06 (1)
  • zkamvar (1)
  • gwarnes-mdsol (1)
  • mcjudd (1)
  • fabeit (1)
  • jasminekhu (1)
  • michaelgasser (1)
  • krlmlr (1)
  • happyshows (1)
  • nahatahemant459 (1)
  • jzadra (1)
  • lgaborini (1)
Pull Request Authors
  • gwarnes-mdsol (5)
  • jeroen (4)
  • olivroy (2)
  • salim-b (1)
  • markvanderloo (1)
  • warnes (1)
Top Labels
Issue Labels
enhancement (3) upstream (1) bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 2,442 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 9
    (may contain duplicates)
  • Total versions: 10
  • Total maintainers: 1
cran.r-project.org: daff

Diff, Patch and Merge for Data.frames

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 9
  • Downloads: 2,442 Last month
Rankings
Stargazers count: 2.9%
Forks count: 4.1%
Dependent repos count: 9.8%
Average: 12.3%
Downloads: 16.2%
Dependent packages count: 28.6%
Maintainers (1)
Last synced: 7 months ago
conda-forge.org: r-daff
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Stargazers count: 27.7%
Dependent repos count: 34.0%
Forks count: 37.3%
Average: 37.6%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • V8 >= 0.6 imports
  • jsonlite * imports
  • utils * imports
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite