Skip to content

currently as_tibble() call needed to add additional_metadata #133

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

Open
ChloeYou opened this issue Jul 4, 2022 · 1 comment
Open

currently as_tibble() call needed to add additional_metadata #133

ChloeYou opened this issue Jul 4, 2022 · 1 comment
Labels
bug Something isn't working P1 medium priority

Comments

@ChloeYou
Copy link
Contributor

ChloeYou commented Jul 4, 2022

ex3 <- jhu_csse_county_level_subset %>%
  filter(time_value > "2021-12-01", state_name == "Massachusetts") %>%
  slice_tail(n = 6)  %>% 
  as_tibble() %>% # needed to add the additional metadata
  mutate(state = rep(tolower("MA"),6)) %>%
  as_epi_df(additional_metadata = c(other_keys = "state"))

It's a bug that if we exclude the as_tibble() line, we silently ignore the additional_metadata arg.

Discovered in #103.

@ChloeYou ChloeYou added the bug Something isn't working label Jul 4, 2022
@ChloeYou ChloeYou changed the title as_tibble() call needed to add additional_metadata currently as_tibble() call needed to add additional_metadata Jul 4, 2022
@rachlobay
Copy link
Collaborator

For the above ex, I think this could be because we are inputting an epi_df into as_epi_df (so lines 255 to 260 of epi_df.R, see below)...

#' @method as_epi_df epi_df
#' @describeIn as_epi_df Simply returns the `epi_df` object unchanged.
#' @export
as_epi_df.epi_df = function(x, ...) {
  return(x)
}

So it is not immediate to me as to what to do about the above bug as I was not the one to wrote that function(because perhaps it is important for other purposes)? But if it is not, that may be where to change to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 medium priority
Projects
None yet
Development

No branches or pull requests

3 participants