Skip to content
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

Case where merge_samples2() fails on creating new sample data #71

Open
mikemc opened this issue Jun 18, 2021 · 2 comments
Open

Case where merge_samples2() fails on creating new sample data #71

mikemc opened this issue Jun 18, 2021 · 2 comments
Labels
aggregation bug Something isn't working

Comments

@mikemc
Copy link
Owner

mikemc commented Jun 18, 2021

grp <- ps.s %>% sample_data %>% ps_tibble %>% 
  # transmute(specimen_id:extraction_protocol:center_id) %>%
  transmute(specimen_id:extraction_protocol:center_id) %>%
  pull(1)
merge_samples2(ps.s, grp)
#> Error: Can't combine `1:1:S1` <date> and `25:1:S1` <double>.
#> Run `rlang::last_error()` to see where the error occurred.

The error is occurring in the call to merge_groups() and the error suggests it has to do with the date columns

@mikemc mikemc added bug Something isn't working aggregation labels Jun 18, 2021
@mikemc
Copy link
Owner Author

mikemc commented Jun 18, 2021

Here is a minimal reproducible example of the bug

group <- c(1,1,2,2,3,3)
dates <- c(NA, NA, "2020-01-01", "2020-01-01", "2020-01-02", "2020-01-03") %>%
  lubridate::as_date()
speedyseq:::merge_groups(
  dates,
  group,
  unique_or_na
)
#> Error: Can't combine `1` <date> and `3` <double>.
#> Run `rlang::last_error()` to see where the error occurred.

@mikemc
Copy link
Owner Author

mikemc commented Jun 18, 2021

Strangely, this only seems to create an error in merge_samples2() when group is a vector rather than the name of a column in the sample data

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

No branches or pull requests

1 participant