Learn R Programming

versus (version 0.3.1)

slice_diffs: Get rows with differing values

Description

Get rows with differing values

Usage

slice_diffs(comparison, table, column = everything())

Value

The input table is filtered to the rows for which comparison

shows differing values for one of the columns selected by column

Arguments

comparison

The output of compare()

table

A string matching one of the identifiers supplied via table_id when calling compare() (defaults are "a" and "b"). Within the comparison, these identifiers are stored in comparison$tables$table.

column

<tidy-select>. A row will be in the output if the comparison shows differing values for any columns matching this argument

Examples

Run this code
comp <- compare(example_df_a, example_df_b, by = car)
comp |> slice_diffs("a", mpg)
comp |> slice_diffs("b", mpg)
comp |> slice_diffs("a", c(mpg, disp))

comp <- compare(example_df_a, example_df_b, by = car, table_id = c("old", "new"))
comp |> slice_diffs("old", mpg)

Run the code above in your browser using DataLab