Overview

RtD3 supports visualizations for subnational estimates using the same interface. Data must have the same structure and columns as global data.

India

Plotting subnational estimates requires that column names are identical to the columns required from global estimates.

geoData <- rnaturalearth::ne_states('India', returnclass = 'sf') %>%
  rename(sovereignt = name_en)

# Read in each summary folder
rtData <- list("Cases" =
RtD3::readInEpiNow2(path = "https://raw.githubusercontent.com/epiforecasts/covid-rt-estimates/master/subnational/india/cases/summary",
                    region_var = "region"))

# Extract summary data from cases
summaryData <- rtData$Cases$summary

## Drop remaining summary data
rtData <- lapply(rtData, function(.){.[-1]})

This data is then passed to RtD3::summaryWidget.

## Warning in name_warning_geoData(name_diff): The following names are present in
## the estimates but not in the GeoData: Andaman and Nicobar, Ladakh, NCT of Delhi,
## Telangana, Unknown.