Skip to content

ungroup() strips off tbl_df class of a rowwise_df #936

@davechilders

Description

@davechilders

This chain returns the class I would expect:

> tbl_df(mtcars) %>% rowwise %>% class
## [1] "rowwise_df" "tbl_df"     "data.frame"

However, if we add ungroup(), the tbl_df class is stripped off:

> tbl_df(mtcars) %>% rowwise %>% ungroup %>% class
## [1] "data.frame"

Is "data.frame" the expected result here?

Note that tbl_df and tbl are preserved when ungroup() is applied to a grouped_df

> tbl_df(mtcars) %>% group_by(cyl) %>% ungroup %>% class
## [1] "tbl_df"     "tbl"        "data.frame"

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_0.4.1

loaded via a namespace (and not attached):
[1] assertthat_0.1 DBI_0.3.1      magrittr_1.0.1 parallel_3.1.2 Rcpp_0.11.3    tools_3.1.2   

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions