Skip to content

covid_hosp_timeseries error when parsing NA values #243

@dshemetov

Description

@dshemetov
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions