A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/tidyverse/dplyr/issues/4051 below:

preservation of class attribute · Issue #4051 · tidyverse/dplyr · GitHub

The class attribute is lost in the released 0.7.8, and preserved in the dev version:

x = as_tibble(iris)
class(x) = c("myclass", class(x))
x %>% dplyr::filter(Sepal.Length < 5) %>% class()

# 0.7.8
# [1] "tbl_df"     "tbl"        "data.frame"

# 0.7.99.9000
# [1] "myclass"    "tbl_df"     "tbl"        "data.frame"

It can be a side effect of the changes in grouped_df (or slice()), and happens with the stable tibble 1.4.2 and other verbs like mutate(). Anyway it is favorable to me and seems to be consistent with the upcoming tibble with subclass support. I just hope it is documented more explicitly so that I can give a clear direction to issues like YuLab-SMU/tidytree#7.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4