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

covid_hosp_timeseries error when parsing NA values #243

Closed
dshemetov opened this issue Jan 31, 2024 · 0 comments · Fixed by #244
Closed

covid_hosp_timeseries error when parsing NA values #243

dshemetov opened this issue Jan 31, 2024 · 0 comments · Fixed by #244

Comments

@dshemetov
Copy link
Contributor

dshemetov commented Jan 31, 2024

library(epidatr)

# Bug
dates <- epirange("2020-11-01", "2020-12-01")
pub_covid_hosp_state_timeseries(
  states = "ca",
  dates = dates,
  # fetch_args = fetch_args_list(dry_run = TRUE)
)
# Error in if (any(value != round(value))) { : 
#   missing value where TRUE/FALSE needed
# Timing stopped at: 0.024 0.001 0.15

The API response is here, which looks fine.

UPDATE: found the offending column (another column geocoded_state was also all NA, but its type is text, so it's fine), it's probably a general problem with int columns with NAs

Browse[2]> value
 [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[23] NA NA NA NA NA NA NA NA NA

Browse[2]> info

── <EpidataFieldInfo> object: ────────────────────────────────────────
name: on_hand_supply_therapeutic_a_casirivimab_imdevimab_courses
type: int
description:
categories:

Browse[2]> c
Error in if (any(value != round(value))) { : 
  missing value where TRUE/FALSE needed
Timing stopped at: 5.347 0.254 220.9
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

Successfully merging a pull request may close this issue.

1 participant