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

Ensure that rows_*() preserves the type of x #6240

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

DavisVaughan
Copy link
Member

This also ensures that we only use data frame operations that we have documented that we use internally. Specifically, this avoids df[i, j] (and its assignment variant) which suffers from drop = FALSE issues with bare data frames. It is replaced with usage of df[i], dplyr_row_slice(), and dplyr_col_modify(). Tests have been added to ensure that we never regress here.

Preserving the column types in x was something that we already document, but this wasn't actually occurring correctly. Instead, we often ended up taking the common type (especially with bare data frames).

This also ensures that we only use data frame operations that we have documented that we use internally. Specifically, this avoids `df[i, j]` (and its assignment variant) which suffers from `drop = FALSE` issues with bare data frames. It is replaced with usage of `df[i]`, `dplyr_row_slice()`, and `dplyr_col_modify()`. Tests have been added to ensure that we never regress here.
@DavisVaughan DavisVaughan merged commit 62e2280 into tidyverse:main Apr 25, 2022
@DavisVaughan DavisVaughan deleted the fix/data-frame-slicing branch April 25, 2022 20:47
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.

None yet

1 participant