liveBook · Manning

Comparedf() function

As explained in Statistics Slam Dunk

The comparedf() function from arsenal compares two data frames or other data sets and returns a summary of their differences.

comparedf() compares two data frames or other data sets and returns a summary of their differences. It is useful when checking whether data-wrangling steps produced equivalent results, especially with larger objects. section 19.3.1 section 19.5

Compare two versions of player data

After preparing test4 and test5 from NBA player data, run arsenal::comparedf(test4, test5). The report states that the objects share five non-by variables and six observations, while one variable is not shared. It also reports that none of the five compared variables differ and that all compared attributes match. section 19.3.1

How Statistics Slam Dunk covers it

How deep it goes
Reports shared and unshared variables, observation counts, value differences, and non-identical attributes.
Examples
Compares test4 and test5, two George Mikan player-data objects with different variable sets.
What it assumes
Assumes prepared data objects and basic R function calls; demonstrates package-qualified invocation.
What you can do after
Diagnose differences between two data sets with arsenal::comparedf().
How it connects
Connects data frames with data wrangling, duplicate-record treatment, and package-qualified function calls.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.