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

error received in some functions if there is 0 data to un-nest #19

Open
sarahollis opened this issue Sep 21, 2023 · 1 comment
Open

Comments

@sarahollis
Copy link
Collaborator

@joshwlambert we have come across this issue before and not sure how to fix it...
i.e. if no contacts have vaccines, an error is thrown when you try to run

cases_vacc_history_clean <- clean_case_vax_history(cases,language_tokens)

after i added at least 1 vaccine to a contact, it ran fine, but before i got this error:

> contacts_vacc_history_clean <- clean_contact_vax_history(contacts,language_tokens)
Error in `tbl_at_vars()`:
! Can't subset columns that don't exist.
✖ Column `vaccinesreceived_date` doesn't exist.
Run `rlang::last_trace()` to see where the error occurred.

it may not be always evident to the analyst what the data contains etc - so is there a way to insert into some of these functions as a safeguard that if there is no data, just proceed with an empty data frame or skip that function and move to the next?

cc @jamesfuller-cdc

@jamesfuller-cdc
Copy link
Collaborator

Would this just be a simple check with an if/else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants