-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorverbs 🏃♀️
Milestone
Description
According to the documentation, select() should preserve attributes ("Data frame attributes are preserved." in section Value). However, this seems to work only for tibbles, not for data frames. This is an reproducible example:
mtcars_df <- mtcars
attr(mtcars_df, "test") <- TRUE
mtcars_tib <- as_tibble(mtcars_df)
attr(mtcars_df, "test")
attr(mtcars_tib, "test")
attr(dplyr::select(mtcars_df), "test")
attr(dplyr::select(mtcars_tib), "test")
With dplyr 0.8.5, all the four calls of attr() return TRUE as expected. But with dplyr 1.0.0, attr(dplyr::select(mtcars_df), "test") returns NULL.
The result does not change, if some columns are selected.
fenrir-naru, Generalized and llrs
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorverbs 🏃♀️