Skip to content

Commit

Permalink
Fix region declration issue, should capture global datatsets
Browse files Browse the repository at this point in the history
  • Loading branch information
truenomad committed Mar 19, 2024
1 parent 538cb13 commit d78b2a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/get_polis_api_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ get_polis_api_data <- function(min_date,
}

# set up region field
if (tolower(region) == "global") {
if (tolower(region) == "global" || is.null(region)) {
region_field <- NULL
} else {
region_field <- get_api_date_suffix(data_type)$region_field
# set up region field name
region_field <- if (data_type == "virus") "RegionName" else "WHORegion"
}

# set up region field name
region_field <- if (data_type == "virus") "RegionName" else "WHORegion"

# Construct the full API URL
api_url <- construct_api_url(
api_endpoint, endpoint_suffix, min_date, max_date,
Expand Down

0 comments on commit d78b2a1

Please sign in to comment.