Coder Social home page Coder Social logo

compare's Introduction

compaRe

The goal of compaRe package is to compare two versions of the same data set and produce the differences between the two.

Installation

You can install the development version of compare as below:

library(devtools)
install_github("Fahim-Ahmad/compaRe")

Usage

library(compaRe)
compare_df(df1, df2, unique_id_df1, unique_id_df2, compare_all = TRUE)

Arguments

df1 Old version of the dataset

df2 Latest version of the dataset

unique_id_df1 unique identifier in df1

unique_id_df2 unique identifier in df2

compare_all logical. TRUE: compare all columns/variables. FALSE: compare only shared columns/variables.

Example

library(compaRe)

mtcars_v1 <- mtcars_v2 <- mtcars
mtcars_v1$id <- mtcars_v2$id <- rownames(mtcars)

mtcars_v2$am[mtcars_v2$am == 1] <- 2
mtcars_v2$wt[mtcars_v2$wt > 100] <- 105
mtcars_v2$cyl[mtcars_v2$cyl == 8] <- 7
mtcars_v2 <- mtcars_v2[1:30, ]
mtcars_v2$rowid <- 1:nrow(mtcars_v2)

compare_df(df1 = mtcars_v1, df2 = mtcars_v2,
          unique_id_df1 = "id",
          unique_id_df2 = "id",
          compare_all = TRUE
          )
          
compare_df(df1 = mtcars_v1, df2 = mtcars_v2,
          unique_id_df1 = "id",
          unique_id_df2 = "id",
          compare_all = FALSE
          )

compare's People

Contributors

fahim-ahmad avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.