Closed
Description
According to the documentation distinct
should preserve attributes for data.frame
objects. Attributes are preserved for tibble
objects, but not for data.frame
objects. Package version: 1.0.7.
library(dplyr, warn.conflicts = FALSE)
df_noattr <- distinct(structure(iris, a="b"))
attr(df_noattr, "a", exact=TRUE)
# NULL
df_attr <- distinct(structure(as_tibble(iris), a="b"))
attr(df_attr, "a", exact=TRUE)
# "b"