filter, slice, arrange dropping attributes #1064
I'm not sure if this is by design or a bug.
I would expect that since filter and slice are subsets of the original data frame that all of the original data frames attributes would go along with it. Similarly since arrange is a reordering of the data I would expect it to keep attributes, much like group_by and select do.
library(dplyr) dat <- as_data_frame(iris) attr(dat, "meta") <- c("This is important") # drops meta attributes dat %>% filter(Species == "setosa") %>% attributes dat %>% slice(1:50) %>% attributes dat %>% arrange(Sepal.Width) %>% attributes # keeps meta attribute dat %>% group_by(Species) %>% attributes dat %>% select(Petal.Length, Petal.Width, Species) %>% attributes
The text was updated successfully, but these errors were encountered: