-
Notifications
You must be signed in to change notification settings - Fork 8
Keep the epi_df
class when head and tail are used
#105
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
Conversation
The comments above are very minor. This PR could be merged to address #96 without any changes. |
@rachlobay I spent a bit of time looking into this, and I think we're doing this the wrong way (my fault). I think we want it to drop the class and the metadata if they do column selection: Good examples are in tibble or probably even better tsibble. I suspect that we essentially need most of the code in the tSibble link. |
Ok. I have removed |
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.
I think there are a few additional tests that we need here, otherwise, the rest is linting.
att_x = attributes(x) | ||
new_epi_df(tibble::as_tibble(res), geo_type = att_x$metadata$geo_type, | ||
time_type = att_x$metadata$time_type, as_of = att_x$metadata$as_of, | ||
additional_metadata = |
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.
I'm not positive, but I suspect that this doesn't actually work. This is just giving you the names without the values.
I think you can safely do additional_metadata = att_x$additional_metadata
but you should probably add a test to check that it works.
Merge branch 'main' of https://github.com/cmu-delphi/epiprocess into head-tail-keep-class # Conflicts: # R/epi_df.R
Some notes:
|
@brookslogan Thanks for the comments! To let you know, I ended up fixing the bug that you spotted in |
As per issue 96
head.epi_df
andtail.epi_df
to keep theepi_df
class when they are used. Note the tests for this in test-methods-epi_df.R