-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New grouped_df
class support with soma_adat
objects
#67
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #67 +/- ##
==========================================
+ Coverage 73.64% 73.88% +0.23%
==========================================
Files 39 39
Lines 1442 1455 +13
==========================================
+ Hits 1062 1075 +13
Misses 380 380 ☔ View full report in Codecov by Sentry. |
499e140
to
63078e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
- grouped_df data objects were interfering with the S3 methods for dplyr verbs of the `soma_adat` class once `NextMethod()` was called - this support now ensures that the group methods are maintained, as well as the `soma_adat` class itself (with its attributes) - fixes SomaLogic#66
- now displays Group information from a call to the S3 print method
- this method is invoked on `rownmaes()` calls to the `soma_adat` class. - Rather than calling `NextMethod()` which normally would invoke `data.frame`, we now force the `data.frame` method in case there are `tbl_df` or `grouped_df` classes present that would be dispatched. Those are bypassed in favor of the `data.frame` because `tbl_df` 1) can nuke the attributes, 2) triggers a warning about adding rownames to a `tibble`
- now uses internal functions with each other as originally intended to avoid redundency
- no need for retro-update-pkgdown.sh
e0e5e51
to
bc418bc
Compare
Overview of Pull Request
Adding new
grouped_df
support for thesoma_adat
class.The combination of
soma_adat
,grouped_df
was interfering with class reconstitution of attrs.Needed to make the underlying S3 methods more robust to
NextMethod()
calls.No user facing changes (beyond bug-fix), except for the S3 print method for
grouped_df
soma_adat
s.Fixes #66
Main changes
dplyr
S3 method verbsgrouped_df
support (thesoma_adat
class is maintained)c("soma_adat", "grouped_df")
classrow.names<-.soma_adat()
method, that is essentially apass thru to the
data.frame
method that ensures no inherited classdispatch happens (e.g.
tbl_df
) ... bypassing the rownames warning on tibbles..soma_adat_restore()
,.sort_attrs()
for thedplyr
verb suite[
extract method forsoma_adat
, for the edge-case ofgrouped_df
soma_adat
s.Change type
Please check the relevant box(es):
Choose reviewer(s)
Code
This should now work: