Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are matching (white) rows displayed in render_diff? #33

Open
fabeit opened this issue Nov 18, 2022 · 2 comments
Open

Why are matching (white) rows displayed in render_diff? #33

fabeit opened this issue Nov 18, 2022 · 2 comments

Comments

@fabeit
Copy link

fabeit commented Nov 18, 2022

From what I understand in the color coding, the color white represents rows which remain unchanged from the source to the target. Why are these displayed by render_diff? And is it possible to not display these rows?

If I select some of these unchanged rows and use them in diff_data I get an empty result, which is correct so I don't understand why they're being displayed when their part of a larger data frame.
Thanks

@warnes
Copy link
Contributor

warnes commented Aug 9, 2023

By default, diff_data provides 1 line before and 1 line after each group of changes. You can change this behavior using the unchanged_context parameter. To avoid showing any unchanged rows, use unchanged_context = 0.

For instance:

iris_minus <- iris[-3,]

render_diff(diff_data(iris, iris_minus))

yields
image

while

iris_minus <- iris[-3,]

render_diff(diff_data(iris, iris_minus, unchanged_context = 0))

yields
image

@warnes
Copy link
Contributor

warnes commented Aug 9, 2023

There is a bug in render_diff that loses the original order of the rows in the comparison table because it gets sorted by the first column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants