#5538 implemented count() as a generic. With this change, dplyr >= 1.0.3 is exhibiting some odd (to me) behavior in regards to rownames and tibbles. It appears that tibbles that are passed in to count() are returned with some different attributes that cause rownames to be printed. If the output of count() is explicitly cast as a tibble, rownames are not printed (as expected). Strangely, the results of these two operations pass a base identical() test but fail an identical(attrib.as.set = FALSE) test, although I don't see any difference in the results of attributes() call on both of the resulting objects. It also appears that the bad object in my reprex returns a true from tibble::has_rownames(), this exists even if I explicitly pass a rownames = FALSE to my as_tibble() call.
The net result of this is that some objects in an analysis workflow are displayed in an html_notebook with rownames and others are not. There may be other side effects that I'm not aware of here.
Expected behavior: bare tibbles as generated by count() are printed without rownames
This is an extension off of a conversation from the RStudio Community - https://community.rstudio.com/t/subtle-difference-on-rownames-between-two-count-ed-tibbles/95090
#5538 implemented
count()as a generic. With this change, dplyr >= 1.0.3 is exhibiting some odd (to me) behavior in regards to rownames and tibbles. It appears that tibbles that are passed in tocount()are returned with some different attributes that cause rownames to be printed. If the output ofcount()is explicitly cast as a tibble, rownames are not printed (as expected). Strangely, the results of these two operations pass a baseidentical()test but fail anidentical(attrib.as.set = FALSE)test, although I don't see any difference in the results ofattributes()call on both of the resulting objects. It also appears that thebadobject in my reprex returns a true fromtibble::has_rownames(), this exists even if I explicitly pass arownames = FALSEto myas_tibble()call.The net result of this is that some objects in an analysis workflow are displayed in an
html_notebookwith rownames and others are not. There may be other side effects that I'm not aware of here.Expected behavior: bare tibbles as generated by
count()are printed without rownamesCreated on 2021-02-04 by the reprex package (v1.0.0)
Session info
The text was updated successfully, but these errors were encountered: