Learn R Programming

versus (version 0.3.1)

weave_diffs_long: Get differences in context

Description

Get differences in context

Usage

weave_diffs_long(comparison, column = everything())

weave_diffs_wide(comparison, column = everything(), suffix = NULL)

Value

weave_diffs_wide()

The input table_a filtered to rows where differing values exist for one of the columns selected by column. The selected columns with differences will be in the result twice, one for each input table.

weave_diffs_long()

Input tables are filtered to rows where differing values exist for one of the columns selected by column. These two sets of rows (one for each input table) are interleaved row-wise.

Arguments

comparison

The output of compare()

column

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

suffix

A character vector of length 2 providing suffixes appended to the renamed columns in weave_diffs_wide(). Set to NULL (the default) to use paste0("_", table_id). The first suffix is applied to values from table_a, the second to values from table_b.

Examples

Run this code
comp <- compare(example_df_a, example_df_b, by = car)
comp |> weave_diffs_wide(disp)
comp |> weave_diffs_wide(c(mpg, disp))
comp |> weave_diffs_wide(c(mpg, disp), suffix = c("", "_new"))
comp |> weave_diffs_long(disp)
comp |> weave_diffs_long(c(mpg, disp))

Run the code above in your browser using DataLab