Title: | Rt Visualization in D3 |
---|---|
Description: | An R interface for the JavaScript library rt_vis(<https://github.com/hamishgibbs/rt_vis>). |
Authors: | Hamish Gibbs [aut, cre] |
Maintainer: | Hamish Gibbs <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-25 06:26:06 UTC |
Source: | https://github.com/epiforecasts/RtD3 |
Get Subregional Estimate Urls
getSubregionalUrls(path, areas)
getSubregionalUrls(path, areas)
path |
A character string container the overall path to subnational estimates |
areas |
A character vector listing the subregional estimates (assuming that listed in the geoData with capitalisation and without capitalisation in the path). |
A named list of subnational urls.
getSubregionalUrls(path = "https://epiforecasts.io/covid/posts/national/", areas = c('Afghanistan', 'Brazil', 'Colombia', 'United States'))
getSubregionalUrls(path = "https://epiforecasts.io/covid/posts/national/", areas = c('Afghanistan', 'Brazil', 'Colombia', 'United States'))
Reads in results from EpiNow2
and converts them into the RtD3
format. Supports
either input via a list object or from a file path/url.
readInEpiNow2(input_list, path, region_var = "region")
readInEpiNow2(input_list, path, region_var = "region")
input_list |
A list of results as returned by |
path |
A character string indicating the path (either file or URL) to the summary results |
region_var |
A character string that identifies the region name used. |
A named list in the format required by summaryWidget
along with a summary table.
# Read in each summary folder base_path <- "https://raw.githubusercontent.com/epiforecasts/covid-rt-estimates/" rtData <- readInEpiNow2( path = paste0(base_path, "master/national/cases/summary"), region_var = "country") rtData
# Read in each summary folder base_path <- "https://raw.githubusercontent.com/epiforecasts/covid-rt-estimates/" rtData <- readInEpiNow2( path = paste0(base_path, "master/national/cases/summary"), region_var = "country") rtData
Create an Rt visualisation using D3
summaryWidget( geoData = NULL, rtData = NULL, activeArea = NULL, activeTime = "all", runDate = NULL, subregional_ref = NULL, width = 900, elementId = NULL, dryRun = FALSE )
summaryWidget( geoData = NULL, rtData = NULL, activeArea = NULL, activeTime = "all", runDate = NULL, subregional_ref = NULL, width = 900, elementId = NULL, dryRun = FALSE )
geoData |
sf object, map data |
rtData |
data.frame, rt estimates in the format 'Source':'rtData':x, 'casesInfectionData':x, 'casesReportData':x, 'obsCasesData':x, ... |
activeArea |
character, the default area to plot. |
activeTime |
character, the default time window (defaults to 'all') |
runDate |
character, date of estimate run in the format ('YYYY-MM-DD') |
subregional_ref |
list, reference to subnational estimates in the format 'country_name':'url', .... |
width |
integer, width in pixels |
elementId |
string, id of element |
dryRun |
Logical, defaults to FALSE. Should the function be tested without the widget being created. Useful for checking the integrity of input data. |
Output and render functions for using summaryWidget within Shiny applications and interactive Rmd documents.
summaryWidgetOutput(outputId, width = "100%", height = "400px") rendersummaryWidget(expr, env = parent.frame(), quoted = FALSE)
summaryWidgetOutput(outputId, width = "100%", height = "400px") rendersummaryWidget(expr, env = parent.frame(), quoted = FALSE)
outputId |
output variable to read from |
width , height
|
Must be a valid CSS unit (like |
expr |
An expression that generates a RtD3 |
env |
The environment in which to evaluate |
quoted |
Is |