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", regions)

Arguments

input_list

A list of results as returned by EpiNow2::regional_summary

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.

regions

A character string indicating the regions of interest to returns. Defaults to all regions.

Value

A named list in the format required by summaryWidget along with a summary table.

Examples

# 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
#> $summaryData
#>              region New confirmed cases by infection date
#>   1:    Afghanistan                       108 (41 -- 500)
#>   2:        Albania                         40 (23 -- 80)
#>   3:        Algeria                           8 (3 -- 21)
#>   4: American Samoa                          9 (0 -- 111)
#>   5:        Andorra                        51 (10 -- 378)
#>  ---                                                     
#> 212:      Venezuela                        41 (21 -- 104)
#> 213:        Vietnam                    1413 (616 -- 3960)
#> 214:          Yemen                            0 (0 -- 0)
#> 215:         Zambia                            0 (0 -- 0)
#> 216:       Zimbabwe                     547 (156 -- 2004)
#>      Expected change in daily cases Effective reproduction no.
#>   1:              Likely increasing          1.3 (0.99 -- 2.1)
#>   2:              Likely increasing            1 (0.86 -- 1.3)
#>   3:              Likely increasing          1.3 (0.97 -- 1.8)
#>   4:                         Stable         0.99 (0.39 -- 2.1)
#>   5:              Likely increasing          1.1 (0.62 -- 1.7)
#>  ---                                                          
#> 212:                         Stable            1 (0.83 -- 1.3)
#> 213:              Likely decreasing         0.88 (0.61 -- 1.3)
#> 214:              Likely decreasing        0.48 (0.091 -- 1.2)
#> 215:                     Decreasing     0.061 (0.0042 -- 0.31)
#> 216:              Likely increasing          1.4 (0.92 -- 2.1)
#>                Rate of growth Doubling/halving time (days)
#>   1:  0.085 (-0.0031 -- 0.27)            8.2 (2.6 -- -220)
#>   2:  0.013 (-0.039 -- 0.091)              53 (7.6 -- -18)
#>   3:    0.08 (-0.0073 -- 0.2)             8.7 (3.4 -- -95)
#>   4:  -0.0033 (-0.19 -- 0.28)           -210 (2.5 -- -3.7)
#>   5:    0.018 (-0.11 -- 0.17)             39 (4.1 -- -6.2)
#>  ---                                                      
#> 212: 0.0028 (-0.049 -- 0.084)             240 (8.3 -- -14)
#> 213:  -0.034 (-0.11 -- 0.091)            -21 (7.6 -- -6.1)
#> 214:    -0.16 (-0.31 -- 0.06)            -4.4 (12 -- -2.2)
#> 215:   -0.33 (-0.39 -- -0.22)          -2.1 (-3.2 -- -1.8)
#> 216:    0.11 (-0.023 -- 0.27)             6.3 (2.6 -- -30)
#> 
#> $rtData
#>             region       date strat     type    median      mean         sd
#>     1: Afghanistan 2022-01-28    NA estimate 0.8617934 0.8761065 0.11383115
#>     2: Afghanistan 2022-01-29    NA estimate 0.8556268 0.8667321 0.10216471
#>     3: Afghanistan 2022-01-30    NA estimate 0.8494871 0.8573524 0.09216038
#>     4: Afghanistan 2022-01-31    NA estimate 0.8426965 0.8480854 0.08393362
#>     5: Afghanistan 2022-02-01    NA estimate 0.8362875 0.8390684 0.07755753
#>    ---                                                                     
#> 27333:    Zimbabwe 2022-05-30    NA forecast 1.4244549 1.4510090 0.36346219
#> 27334:    Zimbabwe 2022-05-31    NA forecast 1.4244549 1.4510090 0.36346219
#> 27335:    Zimbabwe 2022-06-01    NA forecast 1.4244549 1.4510090 0.36346219
#> 27336:    Zimbabwe 2022-06-02    NA forecast 1.4244549 1.4510090 0.36346219
#> 27337:    Zimbabwe 2022-06-03    NA forecast 1.4244549 1.4510090 0.36346219
#>         lower_90  lower_50  lower_20  upper_20  upper_50  upper_90
#>     1: 0.7161549 0.8012999 0.8384035 0.8862717 0.9358411 1.0873540
#>     2: 0.7198539 0.7984970 0.8347461 0.8781922 0.9221883 1.0527433
#>     3: 0.7204793 0.7968413 0.8297664 0.8710640 0.9085521 1.0214378
#>     4: 0.7190176 0.7919147 0.8248325 0.8627942 0.8973678 0.9953365
#>     5: 0.7179829 0.7884031 0.8187431 0.8543160 0.8858928 0.9726089
#>    ---                                                            
#> 27333: 0.9167116 1.2103817 1.3373991 1.5078065 1.6578935 2.0945905
#> 27334: 0.9167116 1.2103817 1.3373991 1.5078065 1.6578935 2.0945905
#> 27335: 0.9167116 1.2103817 1.3373991 1.5078065 1.6578935 2.0945905
#> 27336: 0.9167116 1.2103817 1.3373991 1.5078065 1.6578935 2.0945905
#> 27337: 0.9167116 1.2103817 1.3373991 1.5078065 1.6578935 2.0945905
#> 
#> $casesInfectionData
#>             region       date strat     type median    mean       sd lower_90
#>     1: Afghanistan 2022-01-28    NA estimate  635.6   651.0    126.6    471.1
#>     2: Afghanistan 2022-01-29    NA estimate  618.4   633.9    120.4    462.2
#>     3: Afghanistan 2022-01-30    NA estimate  595.8   609.5    112.3    449.0
#>     4: Afghanistan 2022-01-31    NA estimate  570.4   582.2    103.9    435.2
#>     5: Afghanistan 2022-02-01    NA estimate  544.1   553.7     95.7    418.2
#>    ---                                                                       
#> 27333:    Zimbabwe 2022-05-30    NA forecast 1557.5  7354.9  63967.7    133.4
#> 27334:    Zimbabwe 2022-05-31    NA forecast 1724.8 10035.7 106103.9    130.7
#> 27335:    Zimbabwe 2022-06-01    NA forecast 1902.9 13938.6 176793.5    128.9
#> 27336:    Zimbabwe 2022-06-02    NA forecast 2102.2 19706.5 295621.7    126.7
#> 27337:    Zimbabwe 2022-06-03    NA forecast 2351.6 28352.9 495691.6    124.2
#>        lower_50 lower_20 upper_20 upper_50 upper_90
#>     1:    561.5    608.3    666.6    724.0    871.9
#>     2:    549.5    593.5    649.2    706.2    847.7
#>     3:    531.1    572.1    623.6    677.6    809.9
#>     4:    509.3    547.3    595.6    643.5    769.1
#>     5:    486.9    521.8    568.1    608.7    720.0
#>    ---                                             
#> 27333:    565.2   1040.7   2250.4   4164.5  21629.4
#> 27334:    595.6   1133.1   2540.4   4859.9  27634.1
#> 27335:    625.2   1237.4   2874.3   5686.8  35311.8
#> 27336:    657.2   1348.6   3248.3   6578.5  45076.0
#> 27337:    698.0   1465.8   3673.0   7695.7  57711.3
#> 
#> $casesReportData
#>             region       date strat     type median   mean      sd lower_90
#>     1: Afghanistan 2022-01-28    NA estimate  471.0  584.9   445.7     95.0
#>     2: Afghanistan 2022-01-29    NA estimate  310.0  383.6   293.3     65.9
#>     3: Afghanistan 2022-01-30    NA estimate  272.0  341.3   264.1     53.9
#>     4: Afghanistan 2022-01-31    NA estimate  531.0  648.2   503.4    104.9
#>     5: Afghanistan 2022-02-01    NA estimate  762.0  947.1   745.4    154.9
#>    ---                                                                     
#> 27333:    Zimbabwe 2022-05-30    NA forecast  249.0  697.4  1978.0     24.0
#> 27334:    Zimbabwe 2022-05-31    NA forecast  621.0 1881.6  6049.2     48.9
#> 27335:    Zimbabwe 2022-06-01    NA forecast  912.5 3287.4 14667.6     74.0
#> 27336:    Zimbabwe 2022-06-02    NA forecast  988.0 3773.4 20912.5     72.0
#> 27337:    Zimbabwe 2022-06-03    NA forecast 1007.0 4865.4 25211.0     65.0
#>        lower_50 lower_20 upper_20 upper_50 upper_90
#>     1:    269.0    388.0    575.0    778.2   1444.1
#>     2:    174.0    257.0    377.0    511.2    936.1
#>     3:    151.0    225.0    334.0    455.0    856.0
#>     4:    302.8    430.6    637.4    849.0   1604.2
#>     5:    417.8    617.0    926.4   1245.5   2402.5
#>    ---                                             
#> 27333:     97.0    175.0    362.0    617.2   2325.1
#> 27334:    239.0    432.0    888.0   1599.0   6425.6
#> 27335:    339.0    642.0   1343.4   2415.2  11189.9
#> 27336:    366.8    675.2   1444.4   2784.5  12872.2
#> 27337:    349.0    666.2   1501.4   2936.5  15063.3
#> 
#> $obsCasesData
#>                region       date confirm
#>     1:    Afghanistan 2022-01-28     301
#>     2:        Albania 2022-01-28    1549
#>     3:        Algeria 2022-01-28    2130
#>     4: American Samoa 2022-01-28       0
#>     5:        Andorra 2022-01-28       0
#>    ---                                  
#> 26777:                2022-05-20       0
#> 26778:                2022-05-20       0
#> 26779:                2022-05-20       0
#> 26780:                2022-05-20       0
#> 26781:                2022-05-20       0
#> 



france <- readInEpiNow2(
  path = paste0(base_path, "master/national/cases/summary"),
  region_var = "country",
  regions = "France")

france
#> $summaryData
#>    region New confirmed cases by infection date Expected change in daily cases
#> 1: France                 19050 (8688 -- 36383)              Likely decreasing
#>    Effective reproduction no.          Rate of growth
#> 1:         0.88 (0.61 -- 1.2) -0.033 (-0.11 -- 0.045)
#>    Doubling/halving time (days)
#> 1:               -21 (15 -- -6)
#> 
#> $rtData
#>      region       date strat     type    median      mean         sd  lower_90
#>   1: France 2022-01-28    NA estimate 0.7077474 0.7148735 0.07543965 0.6066662
#>   2: France 2022-01-29    NA estimate 0.7025683 0.7079581 0.06636947 0.6106171
#>   3: France 2022-01-30    NA estimate 0.6973103 0.7014724 0.05829336 0.6152980
#>   4: France 2022-01-31    NA estimate 0.6931728 0.6955274 0.05122777 0.6187650
#>   5: France 2022-02-01    NA estimate 0.6886802 0.6902387 0.04518645 0.6217061
#>  ---                                                                          
#> 123: France 2022-05-30    NA forecast 0.8839622 0.8864191 0.16852887 0.6103625
#> 124: France 2022-05-31    NA forecast 0.8839622 0.8864191 0.16852887 0.6103625
#> 125: France 2022-06-01    NA forecast 0.8839622 0.8864191 0.16852887 0.6103625
#> 126: France 2022-06-02    NA forecast 0.8839622 0.8864191 0.16852887 0.6103625
#> 127: France 2022-06-03    NA forecast 0.8839622 0.8864191 0.16852887 0.6103625
#>       lower_50  lower_20  upper_20  upper_50  upper_90
#>   1: 0.6596165 0.6888232 0.7277506 0.7613219 0.8495634
#>   2: 0.6596907 0.6860281 0.7201484 0.7493823 0.8256539
#>   3: 0.6592762 0.6828454 0.7127718 0.7394193 0.8042868
#>   4: 0.6593623 0.6793969 0.7066325 0.7290580 0.7852724
#>   5: 0.6589813 0.6769954 0.7003684 0.7194838 0.7679247
#>  ---                                                  
#> 123: 0.7837399 0.8449420 0.9183922 0.9873049 1.1671552
#> 124: 0.7837399 0.8449420 0.9183922 0.9873049 1.1671552
#> 125: 0.7837399 0.8449420 0.9183922 0.9873049 1.1671552
#> 126: 0.7837399 0.8449420 0.9183922 0.9873049 1.1671552
#> 127: 0.7837399 0.8449420 0.9183922 0.9873049 1.1671552
#> 
#> $casesInfectionData
#>      region       date strat     type   median     mean      sd lower_90
#>   1: France 2022-01-28    NA estimate 244690.8 246467.2 22088.2 212785.0
#>   2: France 2022-01-29    NA estimate 228275.4 229748.0 20444.7 198445.2
#>   3: France 2022-01-30    NA estimate 210528.1 211779.7 18589.9 183080.9
#>   4: France 2022-01-31    NA estimate 193128.4 194145.8 16763.9 168089.2
#>   5: France 2022-02-01    NA estimate 176739.0 177438.2 15046.0 154020.5
#>  ---                                                                    
#> 123: France 2022-05-30    NA forecast  13844.2  19965.2 23273.5   2879.9
#> 124: France 2022-05-31    NA forecast  13435.8  20180.8 25771.5   2568.7
#> 125: France 2022-06-01    NA forecast  13024.9  20451.4 28609.8   2300.7
#> 126: France 2022-06-02    NA forecast  12614.2  20780.4 31845.9   2062.1
#> 127: France 2022-06-03    NA forecast  12227.6  21171.6 35547.1   1842.5
#>      lower_50 lower_20 upper_20 upper_50 upper_90
#>   1: 231228.5 239374.2 249981.9 260081.2 286242.1
#>   2: 215545.7 223335.6 233208.9 242432.8 266466.4
#>   3: 198836.3 205890.1 215183.9 223492.7 244487.8
#>   4: 182323.7 189058.5 197136.0 205070.5 222990.7
#>   5: 166919.0 172942.1 180260.2 187488.2 202830.0
#>  ---                                             
#> 123:   8160.5  11458.7  16814.1  23886.4  54627.2
#> 124:   7654.3  10987.8  16469.2  23857.6  57019.4
#> 125:   7217.5  10548.5  16115.4  23675.4  59373.9
#> 126:   6802.6  10126.2  15774.2  23614.2  61896.0
#> 127:   6413.3   9712.8  15455.6  23555.0  64529.0
#> 
#> $casesReportData
#>      region       date strat     type   median     mean      sd lower_90
#>   1: France 2022-01-28    NA estimate 301018.0 311799.3 94864.1 174257.5
#>   2: France 2022-01-29    NA estimate 305030.5 314555.0 94966.8 178146.7
#>   3: France 2022-01-30    NA estimate 315523.0 327937.1 98307.4 186613.8
#>   4: France 2022-01-31    NA estimate 254786.0 263554.6 78227.6 150345.1
#>   5: France 2022-02-01    NA estimate  54338.5  56027.3 15963.8  33212.9
#>  ---                                                                    
#> 123: France 2022-05-30    NA forecast  13913.0  16660.7 11594.8   4904.0
#> 124: France 2022-05-31    NA forecast   2911.5   3601.9  2756.2    936.9
#> 125: France 2022-06-01    NA forecast  22466.5  28271.4 23552.2   6857.6
#> 126: France 2022-06-02    NA forecast  18976.5  24938.5 22700.7   5516.4
#> 127: France 2022-06-03    NA forecast  17208.5  23551.3 24876.1   4659.9
#>      lower_50 lower_20 upper_20 upper_50 upper_90
#>   1: 243424.2 278592.4 326289.4 368319.5 482151.1
#>   2: 247820.2 281947.2 327274.4 368742.0 483814.5
#>   3: 258085.0 292477.0 340605.4 386740.0 505144.8
#>   4: 207333.2 235181.2 276244.8 311721.0 403760.3
#>   5:  44681.8  50616.2  58543.8  65746.8  84670.2
#>  ---                                             
#> 123:   9275.8  11951.4  16028.0  20725.0  36983.1
#> 124:   1904.0   2489.0   3392.0   4396.8   8587.0
#> 125:  14379.2  19063.2  26182.4  34652.2  68376.1
#> 126:  12244.8  16249.4  22808.8  30318.2  61709.7
#> 127:  10542.8  14420.0  20836.8  28351.0  59546.5
#> 
#> $obsCasesData
#>      region       date confirm
#>   1: France 2022-01-28  390453
#>   2: France 2022-01-29  337275
#>   3: France 2022-01-30  330747
#>   4: France 2022-01-31  240671
#>   5: France 2022-02-01   82378
#>  ---                          
#> 109: France 2022-05-16   17301
#> 110: France 2022-05-17    5936
#> 111: France 2022-05-18   43727
#> 112: France 2022-05-19   29995
#> 113: France 2022-05-20   22962
#>