Skip to content

Conversation

@tinarozsos
Copy link

Proposed fix to issue #1583.

If .remove = TRUE, uncount() should remove the weight column from the output. Currently this only happens when weight is a variable, but not when using .data$var, because the column is set to NULL only when quo_is_symbol(weights_quo) is TRUE.

The PR adds another condition that looks for a data masking expression, and if found, sets the weight variable to NULL. A new test shows that uncount(df, var) and uncount(df, .data$var) now give the same output.

This PR was prepared in collaboration with @gguyver.

@tinarozsos tinarozsos marked this pull request as ready for review November 10, 2025 16:28
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

Successfully merging this pull request may close these issues.

1 participant