├── .Rhistory ├── .Rproj.user ├── DF2E3E9E │ └── sources │ │ ├── prop │ │ ├── BD39E3FA │ │ └── INDEX │ │ └── s-660F424 │ │ └── lock_file └── shared │ └── notebooks │ ├── patch-chunk-names │ └── paths ├── .gitignore ├── Interactive plotting with R.pptx ├── LICENSE ├── README.md ├── covid_data.csv ├── custom.json ├── echarts ├── answer_sheet_echarts.R └── coding_sheet_echarts.R ├── exercise_3.Rmd ├── int_plotting_training.Rproj ├── mhtreatment_data.csv ├── plotly ├── answer_sheet_plotly.R └── coding_sheet_plotly.R └── www └── nhsr_logo.png /.Rhistory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AYu1804/int_plotting_training/46b99c1eef3dc2efef727aab143bffd75cf5c9a8/.Rhistory -------------------------------------------------------------------------------- /.Rproj.user/DF2E3E9E/sources/prop/BD39E3FA: -------------------------------------------------------------------------------- 1 | { 2 | "cursorPosition" : "8,15", 3 | "scrollLine" : "0" 4 | } -------------------------------------------------------------------------------- /.Rproj.user/DF2E3E9E/sources/prop/INDEX: -------------------------------------------------------------------------------- 1 | ~%2FProjects%2Fint_plotting_training%2F.git%2Fconfig="BD39E3FA" 2 | -------------------------------------------------------------------------------- /.Rproj.user/DF2E3E9E/sources/s-660F424/lock_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AYu1804/int_plotting_training/46b99c1eef3dc2efef727aab143bffd75cf5c9a8/.Rproj.user/DF2E3E9E/sources/s-660F424/lock_file -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/patch-chunk-names: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AYu1804/int_plotting_training/46b99c1eef3dc2efef727aab143bffd75cf5c9a8/.Rproj.user/shared/notebooks/patch-chunk-names -------------------------------------------------------------------------------- /.Rproj.user/shared/notebooks/paths: -------------------------------------------------------------------------------- 1 | C:/Users/aozar/OneDrive/Documents/Projects/int_plotting_training/.git/config="5F637859" 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /Interactive plotting with R.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AYu1804/int_plotting_training/46b99c1eef3dc2efef727aab143bffd75cf5c9a8/Interactive plotting with R.pptx -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Interactive Plotting with R Short Course 2 | 3 | The workshop will cover creating interactive graphs using plotly and echarts4r packages as well as the motivations behind using interactive graphs in reports and apps. It will go through the basic syntax of each package and how to create basic bar, scatter, and line graphs while customising the hover labels, legends, and themes. I will go through additional functionalities of each package, such as adding buttons, additional layers, and grouping/linkage between graphs. The session will have some basic exercises with optional additional challenges to create complex plots and render it using Rmarkdown. 4 | 5 | To view the contents, clone this repository into your local machine and open the Powerpoint file for instructions on how to use course contents. 6 | -------------------------------------------------------------------------------- /covid_data.csv: -------------------------------------------------------------------------------- 1 | areaCode,areaName,areaType,date,newCasesByPublishDate,rollingAvg,caseRate 2 | E10000015,Hertfordshire,utla,2021-04-01,66,66,5.55 3 | E12000006,East of England,region,2021-04-01,331,331,5.31 4 | E92000001,England,nation,2021-04-01,3784,3784,6.72 5 | E10000015,Hertfordshire,utla,2021-04-02,37,51.5,4.33 6 | E12000006,East of England,region,2021-04-02,260,295.5,4.74 7 | E92000001,England,nation,2021-04-02,2881,3332.5,5.92 8 | E10000015,Hertfordshire,utla,2021-04-03,54,52.333333333333336,4.4 9 | E12000006,East of England,region,2021-04-03,227,272.6666666666667,4.37 10 | E92000001,England,nation,2021-04-03,2847,3170.6666666666665,5.63 11 | E10000015,Hertfordshire,utla,2021-04-04,35,48,4.04 12 | E12000006,East of England,region,2021-04-04,158,244,3.91 13 | E92000001,England,nation,2021-04-04,1954,2866.5,5.09 14 | E10000015,Hertfordshire,utla,2021-04-05,24,43.2,3.63 15 | E12000006,East of England,region,2021-04-05,141,223.4,3.58 16 | E92000001,England,nation,2021-04-05,2236,2740.4,4.87 17 | E10000015,Hertfordshire,utla,2021-04-06,37,42.166666666666664,3.54 18 | E12000006,East of England,region,2021-04-06,191,218,3.5 19 | E92000001,England,nation,2021-04-06,1937,2606.5,4.63 20 | E10000015,Hertfordshire,utla,2021-04-07,31,40.57142857142857,3.41 21 | E12000006,East of England,region,2021-04-07,198,215.14285714285714,3.45 22 | E92000001,England,nation,2021-04-07,2304,2563.285714285714,4.55 23 | E10000015,Hertfordshire,utla,2021-04-08,31,35.57142857142857,2.99 24 | E12000006,East of England,region,2021-04-08,202,196.71428571428572,3.15 25 | E92000001,England,nation,2021-04-08,2486,2377.8571428571427,4.22 26 | E10000015,Hertfordshire,utla,2021-04-09,0,30.285714285714285,2.55 27 | E12000006,East of England,region,2021-04-09,0,159.57142857142858,2.56 28 | E92000001,England,nation,2021-04-09,2638,2343.1428571428573,4.16 29 | E10000015,Hertfordshire,utla,2021-04-10,25,26.142857142857142,2.2 30 | E12000006,East of England,region,2021-04-10,161,150.14285714285714,2.41 31 | E92000001,England,nation,2021-04-10,2032,2226.714285714286,3.96 32 | E10000015,Hertfordshire,utla,2021-04-11,17,23.571428571428573,1.98 33 | E12000006,East of England,region,2021-04-11,106,142.71428571428572,2.29 34 | E92000001,England,nation,2021-04-11,1338,2138.714285714286,3.8 35 | E10000015,Hertfordshire,utla,2021-04-12,72,30.428571428571427,2.56 36 | E12000006,East of England,region,2021-04-12,369,175.28571428571428,2.81 37 | E92000001,England,nation,2021-04-12,3222,2279.5714285714284,4.05 38 | E10000015,Hertfordshire,utla,2021-04-13,36,30.285714285714285,2.55 39 | E12000006,East of England,region,2021-04-13,204,177.14285714285714,2.84 40 | E92000001,England,nation,2021-04-13,2070,2298.5714285714284,4.08 41 | E10000015,Hertfordshire,utla,2021-04-14,26,29.571428571428573,2.49 42 | E12000006,East of England,region,2021-04-14,146,169.71428571428572,2.72 43 | E92000001,England,nation,2021-04-14,2054,2262.8571428571427,4.02 44 | E10000015,Hertfordshire,utla,2021-04-15,35,30.142857142857142,2.53 45 | E12000006,East of England,region,2021-04-15,222,172.57142857142858,2.77 46 | E92000001,England,nation,2021-04-15,2171,2217.8571428571427,3.94 47 | E10000015,Hertfordshire,utla,2021-04-16,39,35.714285714285715,3 48 | E12000006,East of England,region,2021-04-16,206,202,3.24 49 | E92000001,England,nation,2021-04-16,2225,2158.8571428571427,3.84 50 | E10000015,Hertfordshire,utla,2021-04-17,23,35.42857142857143,2.98 51 | E12000006,East of England,region,2021-04-17,176,204.14285714285714,3.27 52 | E92000001,England,nation,2021-04-17,1897,2139.5714285714284,3.8 53 | E10000015,Hertfordshire,utla,2021-04-18,28,37,3.11 54 | E12000006,East of England,region,2021-04-18,134,208.14285714285714,3.34 55 | E92000001,England,nation,2021-04-18,1495,2162,3.84 56 | E10000015,Hertfordshire,utla,2021-04-19,39,32.285714285714285,2.71 57 | E12000006,East of England,region,2021-04-19,228,188,3.01 58 | E92000001,England,nation,2021-04-19,2550,2066,3.67 59 | E10000015,Hertfordshire,utla,2021-04-20,36,32.285714285714285,2.71 60 | E12000006,East of England,region,2021-04-20,205,188.14285714285714,3.02 61 | E92000001,England,nation,2021-04-20,2169,2080.1428571428573,3.7 62 | E10000015,Hertfordshire,utla,2021-04-21,35,33.57142857142857,2.82 63 | E12000006,East of England,region,2021-04-21,148,188.42857142857142,3.02 64 | E92000001,England,nation,2021-04-21,1943,2064.285714285714,3.67 65 | E10000015,Hertfordshire,utla,2021-04-22,23,31.857142857142858,2.68 66 | E12000006,East of England,region,2021-04-22,212,187,3 67 | E92000001,England,nation,2021-04-22,2315,2084.8571428571427,3.7 68 | E10000015,Hertfordshire,utla,2021-04-23,44,32.57142857142857,2.74 69 | E12000006,East of England,region,2021-04-23,242,192.14285714285714,3.08 70 | E92000001,England,nation,2021-04-23,2277,2092.285714285714,3.72 71 | E10000015,Hertfordshire,utla,2021-04-24,28,33.285714285714285,2.8 72 | E12000006,East of England,region,2021-04-24,163,190.28571428571428,3.05 73 | E92000001,England,nation,2021-04-24,1804,2079,3.69 74 | E10000015,Hertfordshire,utla,2021-04-25,13,31.142857142857142,2.62 75 | E12000006,East of England,region,2021-04-25,132,190,3.05 76 | E92000001,England,nation,2021-04-25,1401,2065.5714285714284,3.67 77 | E10000015,Hertfordshire,utla,2021-04-26,33,30.285714285714285,2.55 78 | E12000006,East of England,region,2021-04-26,222,189.14285714285714,3.03 79 | E92000001,England,nation,2021-04-26,1752,1951.5714285714287,3.47 80 | E10000015,Hertfordshire,utla,2021-04-27,37,30.428571428571427,2.56 81 | E12000006,East of England,region,2021-04-27,267,198,3.18 82 | E92000001,England,nation,2021-04-27,2410,1986,3.53 83 | E10000015,Hertfordshire,utla,2021-04-28,27,29.285714285714285,2.46 84 | E12000006,East of England,region,2021-04-28,138,196.57142857142858,3.15 85 | E92000001,England,nation,2021-04-28,1829,1969.7142857142858,3.5 86 | E10000015,Hertfordshire,utla,2021-04-29,38,31.428571428571427,2.64 87 | E12000006,East of England,region,2021-04-29,181,192.14285714285714,3.08 88 | E92000001,England,nation,2021-04-29,2103,1939.4285714285713,3.45 89 | E10000015,Hertfordshire,utla,2021-04-30,35,30.142857142857142,2.53 90 | E12000006,East of England,region,2021-04-30,174,182.42857142857142,2.93 91 | E92000001,England,nation,2021-04-30,2046,1906.4285714285713,3.39 92 | E10000015,Hertfordshire,utla,2021-05-01,19,28.857142857142858,2.43 93 | E12000006,East of England,region,2021-05-01,132,178,2.85 94 | E92000001,England,nation,2021-05-01,1642,1883.2857142857142,3.35 95 | E10000015,Hertfordshire,utla,2021-05-02,17,29.428571428571427,2.47 96 | E12000006,East of England,region,2021-05-02,134,178.28571428571428,2.86 97 | E92000001,England,nation,2021-05-02,1377,1879.857142857143,3.34 98 | E10000015,Hertfordshire,utla,2021-05-03,24,28.142857142857142,2.37 99 | E12000006,East of England,region,2021-05-03,154,168.57142857142858,2.7 100 | E92000001,England,nation,2021-05-03,1453,1837.142857142857,3.26 101 | E10000015,Hertfordshire,utla,2021-05-04,29,27,2.27 102 | E12000006,East of England,region,2021-05-04,158,153,2.45 103 | E92000001,England,nation,2021-05-04,1659,1729.857142857143,3.07 104 | E10000015,Hertfordshire,utla,2021-05-05,25,26.714285714285715,2.25 105 | E12000006,East of England,region,2021-05-05,157,155.71428571428572,2.5 106 | E92000001,England,nation,2021-05-05,1906,1740.857142857143,3.09 107 | E10000015,Hertfordshire,utla,2021-05-06,38,26.714285714285715,2.25 108 | E12000006,East of England,region,2021-05-06,224,161.85714285714286,2.6 109 | E92000001,England,nation,2021-05-06,2194,1753.857142857143,3.12 110 | E10000015,Hertfordshire,utla,2021-05-07,36,26.857142857142858,2.26 111 | E12000006,East of England,region,2021-05-07,219,168.28571428571428,2.7 112 | E92000001,England,nation,2021-05-07,2142,1767.5714285714287,3.14 113 | E10000015,Hertfordshire,utla,2021-05-08,23,27.428571428571427,2.31 114 | E12000006,East of England,region,2021-05-08,142,169.71428571428572,2.72 115 | E92000001,England,nation,2021-05-08,1742,1781.857142857143,3.17 116 | E10000015,Hertfordshire,utla,2021-05-09,20,27.857142857142858,2.34 117 | E12000006,East of England,region,2021-05-09,104,165.42857142857142,2.65 118 | E92000001,England,nation,2021-05-09,1418,1787.7142857142858,3.18 119 | E10000015,Hertfordshire,utla,2021-05-10,32,29,2.44 120 | E12000006,East of England,region,2021-05-10,199,171.85714285714286,2.76 121 | E92000001,England,nation,2021-05-10,2009,1867.142857142857,3.32 122 | E10000015,Hertfordshire,utla,2021-05-11,41,30.714285714285715,2.58 123 | E12000006,East of England,region,2021-05-11,233,182.57142857142858,2.93 124 | E92000001,England,nation,2021-05-11,2117,1932.5714285714287,3.43 125 | E10000015,Hertfordshire,utla,2021-05-12,8,28.285714285714285,2.38 126 | E12000006,East of England,region,2021-05-12,157,182.57142857142858,2.93 127 | E92000001,England,nation,2021-05-12,1804,1918,3.41 128 | E10000015,Hertfordshire,utla,2021-05-13,34,27.714285714285715,2.33 129 | E12000006,East of England,region,2021-05-13,215,181.28571428571428,2.91 130 | E92000001,England,nation,2021-05-13,2229,1923,3.42 131 | E10000015,Hertfordshire,utla,2021-05-14,30,26.857142857142858,2.26 132 | E12000006,East of England,region,2021-05-14,182,176,2.82 133 | E92000001,England,nation,2021-05-14,1828,1878.142857142857,3.34 134 | E10000015,Hertfordshire,utla,2021-05-15,24,27,2.27 135 | E12000006,East of England,region,2021-05-15,161,178.71428571428572,2.87 136 | E92000001,England,nation,2021-05-15,1614,1859.857142857143,3.3 137 | E10000015,Hertfordshire,utla,2021-05-16,21,27.142857142857142,2.28 138 | E12000006,East of England,region,2021-05-16,132,182.71428571428572,2.93 139 | E92000001,England,nation,2021-05-16,1471,1867.4285714285713,3.32 140 | E10000015,Hertfordshire,utla,2021-05-17,17,25,2.1 141 | E12000006,East of England,region,2021-05-17,122,171.71428571428572,2.75 142 | E92000001,England,nation,2021-05-17,1645,1815.4285714285713,3.23 143 | E10000015,Hertfordshire,utla,2021-05-18,0,19.142857142857142,1.61 144 | E12000006,East of England,region,2021-05-18,0,138.42857142857142,2.22 145 | E92000001,England,nation,2021-05-18,2008,1799.857142857143,3.2 146 | E10000015,Hertfordshire,utla,2021-05-19,25,21.571428571428573,1.81 147 | E12000006,East of England,region,2021-05-19,114,132.28571428571428,2.12 148 | E92000001,England,nation,2021-05-19,2151,1849.4285714285713,3.29 149 | E10000015,Hertfordshire,utla,2021-05-20,35,21.714285714285715,1.83 150 | E12000006,East of England,region,2021-05-20,184,127.85714285714286,2.05 151 | E92000001,England,nation,2021-05-20,2307,1860.5714285714287,3.31 152 | E10000015,Hertfordshire,utla,2021-05-21,32,22,1.85 153 | E12000006,East of England,region,2021-05-21,198,130.14285714285714,2.09 154 | E92000001,England,nation,2021-05-21,2303,1928.4285714285713,3.43 155 | E10000015,Hertfordshire,utla,2021-05-22,23,21.857142857142858,1.84 156 | E12000006,East of England,region,2021-05-22,150,128.57142857142858,2.06 157 | E92000001,England,nation,2021-05-22,2242,2018.142857142857,3.59 158 | E10000015,Hertfordshire,utla,2021-05-23,19,21.571428571428573,1.81 159 | E12000006,East of England,region,2021-05-23,134,128.85714285714286,2.07 160 | E92000001,England,nation,2021-05-23,1734,2055.714285714286,3.65 161 | E10000015,Hertfordshire,utla,2021-05-24,42,25.142857142857142,2.11 162 | E12000006,East of England,region,2021-05-24,180,137.14285714285714,2.2 163 | E92000001,England,nation,2021-05-24,1972,2102.4285714285716,3.74 164 | E10000015,Hertfordshire,utla,2021-05-25,29,29.285714285714285,2.46 165 | E12000006,East of England,region,2021-05-25,158,159.71428571428572,2.56 166 | E92000001,England,nation,2021-05-25,2081,2112.8571428571427,3.75 167 | E10000015,Hertfordshire,utla,2021-05-26,46,32.285714285714285,2.71 168 | E12000006,East of England,region,2021-05-26,164,166.85714285714286,2.68 169 | E92000001,England,nation,2021-05-26,2540,2168.4285714285716,3.85 170 | E10000015,Hertfordshire,utla,2021-05-27,45,33.714285714285715,2.83 171 | E12000006,East of England,region,2021-05-27,224,172.57142857142858,2.77 172 | E92000001,England,nation,2021-05-27,2936,2258.285714285714,4.01 173 | E10000015,Hertfordshire,utla,2021-05-28,56,37.142857142857146,3.12 174 | E12000006,East of England,region,2021-05-28,236,178,2.85 175 | E92000001,England,nation,2021-05-28,3434,2419.8571428571427,4.3 176 | E10000015,Hertfordshire,utla,2021-05-29,43,40,3.36 177 | E12000006,East of England,region,2021-05-29,187,183.28571428571428,2.94 178 | E92000001,England,nation,2021-05-29,2747,2492,4.43 179 | E10000015,Hertfordshire,utla,2021-05-30,27,41.142857142857146,3.46 180 | E12000006,East of England,region,2021-05-30,116,180.71428571428572,2.9 181 | E92000001,England,nation,2021-05-30,2621,2618.714285714286,4.65 182 | E10000015,Hertfordshire,utla,2021-05-31,45,41.57142857142857,3.49 183 | E12000006,East of England,region,2021-05-31,188,181.85714285714286,2.92 184 | E92000001,England,nation,2021-05-31,2854,2744.714285714286,4.88 185 | E10000015,Hertfordshire,utla,2021-06-01,41,43.285714285714285,3.64 186 | E12000006,East of England,region,2021-06-01,160,182.14285714285714,2.92 187 | E92000001,England,nation,2021-06-01,2539,2810.1428571428573,4.99 188 | E10000015,Hertfordshire,utla,2021-06-02,48,43.57142857142857,3.66 189 | E12000006,East of England,region,2021-06-02,181,184.57142857142858,2.96 190 | E92000001,England,nation,2021-06-02,3486,2945.285714285714,5.23 191 | E10000015,Hertfordshire,utla,2021-06-03,41,43,3.61 192 | E12000006,East of England,region,2021-06-03,210,182.57142857142858,2.93 193 | E92000001,England,nation,2021-06-03,4310,3141.5714285714284,5.58 194 | E10000015,Hertfordshire,utla,2021-06-04,77,46,3.87 195 | E12000006,East of England,region,2021-06-04,340,197.42857142857142,3.17 196 | E92000001,England,nation,2021-06-04,5102,3379.8571428571427,6 197 | E10000015,Hertfordshire,utla,2021-06-05,44,46.142857142857146,3.88 198 | E12000006,East of England,region,2021-06-05,244,205.57142857142858,3.3 199 | E92000001,England,nation,2021-06-05,4810,3674.5714285714284,6.53 200 | E10000015,Hertfordshire,utla,2021-06-06,41,48.142857142857146,4.05 201 | E12000006,East of England,region,2021-06-06,211,219.14285714285714,3.51 202 | E92000001,England,nation,2021-06-06,4405,3929.4285714285716,6.98 203 | E10000015,Hertfordshire,utla,2021-06-07,79,53,4.46 204 | E12000006,East of England,region,2021-06-07,321,238.14285714285714,3.82 205 | E92000001,England,nation,2021-06-07,4913,4223.571428571428,7.5 206 | E10000015,Hertfordshire,utla,2021-06-08,71,57.285714285714285,4.82 207 | E12000006,East of England,region,2021-06-08,313,260,4.17 208 | E92000001,England,nation,2021-06-08,5250,4610.857142857143,8.19 209 | E10000015,Hertfordshire,utla,2021-06-09,51,57.714285714285715,4.85 210 | E12000006,East of England,region,2021-06-09,227,266.57142857142856,4.27 211 | E92000001,England,nation,2021-06-09,6201,4998.714285714285,8.88 212 | E10000015,Hertfordshire,utla,2021-06-10,78,63,5.3 213 | E12000006,East of England,region,2021-06-10,427,297.57142857142856,4.77 214 | E92000001,England,nation,2021-06-10,6436,5302.428571428572,9.42 215 | E10000015,Hertfordshire,utla,2021-06-11,89,64.71428571428571,5.44 216 | E12000006,East of England,region,2021-06-11,317,294.2857142857143,4.72 217 | E92000001,England,nation,2021-06-11,6782,5542.428571428572,9.85 218 | E10000015,Hertfordshire,utla,2021-06-12,73,68.85714285714286,5.79 219 | E12000006,East of England,region,2021-06-12,299,302.14285714285717,4.85 220 | E92000001,England,nation,2021-06-12,6601,5798.285714285715,10.3 221 | E10000015,Hertfordshire,utla,2021-06-13,54,70.71428571428571,5.94 222 | E12000006,East of England,region,2021-06-13,256,308.57142857142856,4.95 223 | E92000001,England,nation,2021-06-13,6269,6064.571428571428,10.77 224 | E10000015,Hertfordshire,utla,2021-06-14,90,72.28571428571429,6.08 225 | E12000006,East of England,region,2021-06-14,344,311.85714285714283,5 226 | E92000001,England,nation,2021-06-14,6647,6312.285714285715,11.21 227 | E10000015,Hertfordshire,utla,2021-06-15,93,75.42857142857143,6.34 228 | E12000006,East of England,region,2021-06-15,385,322.14285714285717,5.17 229 | E92000001,England,nation,2021-06-15,6486,6488.857142857143,11.53 230 | E10000015,Hertfordshire,utla,2021-06-16,87,80.57142857142857,6.77 231 | E12000006,East of England,region,2021-06-16,340,338.2857142857143,5.42 232 | E92000001,England,nation,2021-06-16,7642,6694.714285714285,11.89 233 | E10000015,Hertfordshire,utla,2021-06-17,158,92,7.73 234 | E12000006,East of England,region,2021-06-17,439,340,5.45 235 | E92000001,England,nation,2021-06-17,9371,7114,12.64 236 | E10000015,Hertfordshire,utla,2021-06-18,120,96.42857142857143,8.11 237 | E12000006,East of England,region,2021-06-18,429,356,5.71 238 | E92000001,England,nation,2021-06-18,9185,7457.285714285715,13.25 239 | E10000015,Hertfordshire,utla,2021-06-19,154,108,9.08 240 | E12000006,East of England,region,2021-06-19,443,376.57142857142856,6.04 241 | E92000001,England,nation,2021-06-19,8954,7793.428571428572,13.85 242 | E10000015,Hertfordshire,utla,2021-06-20,126,118.28571428571429,9.94 243 | E12000006,East of England,region,2021-06-20,421,400.14285714285717,6.42 244 | E92000001,England,nation,2021-06-20,7778,8009,14.23 245 | E10000015,Hertfordshire,utla,2021-06-21,117,122.14285714285714,10.27 246 | E12000006,East of England,region,2021-06-21,411,409.7142857142857,6.57 247 | E92000001,England,nation,2021-06-21,8766,8311.714285714286,14.77 248 | E10000015,Hertfordshire,utla,2021-06-22,140,128.85714285714286,10.83 249 | E12000006,East of England,region,2021-06-22,442,417.85714285714283,6.7 250 | E92000001,England,nation,2021-06-22,9096,8684.57142857143,15.43 251 | E10000015,Hertfordshire,utla,2021-06-23,202,145.28571428571428,12.21 252 | E12000006,East of England,region,2021-06-23,661,463.7142857142857,7.44 253 | E92000001,England,nation,2021-06-23,12765,9416.42857142857,16.73 254 | E10000015,Hertfordshire,utla,2021-06-24,207,152.28571428571428,12.8 255 | E12000006,East of England,region,2021-06-24,730,505.2857142857143,8.1 256 | E92000001,England,nation,2021-06-24,13068,9944.57142857143,17.67 257 | E10000015,Hertfordshire,utla,2021-06-25,217,166.14285714285714,13.97 258 | E12000006,East of England,region,2021-06-25,744,550.2857142857143,8.82 259 | E92000001,England,nation,2021-06-25,13498,10560.714285714286,18.76 260 | E10000015,Hertfordshire,utla,2021-06-26,224,176.14285714285714,14.81 261 | E12000006,East of England,region,2021-06-26,742,593,9.51 262 | E92000001,England,nation,2021-06-26,15136,11443.857142857143,20.33 263 | E10000015,Hertfordshire,utla,2021-06-27,206,187.57142857142858,15.77 264 | E12000006,East of England,region,2021-06-27,692,631.7142857142857,10.13 265 | E92000001,England,nation,2021-06-27,11560,11984.142857142857,21.29 266 | E10000015,Hertfordshire,utla,2021-06-28,306,214.57142857142858,18.04 267 | E12000006,East of England,region,2021-06-28,1150,737.2857142857143,11.82 268 | E92000001,England,nation,2021-06-28,18702,13403.57142857143,23.81 269 | E10000015,Hertfordshire,utla,2021-06-29,282,234.85714285714286,19.74 270 | E12000006,East of England,region,2021-06-29,1051,824.2857142857143,13.22 271 | E92000001,England,nation,2021-06-29,16802,14504.42857142857,25.77 272 | E10000015,Hertfordshire,utla,2021-06-30,262,243.42857142857142,20.46 273 | E12000006,East of England,region,2021-06-30,1022,875.8571428571429,14.05 274 | E92000001,England,nation,2021-06-30,21293,15722.714285714286,27.93 275 | E10000015,Hertfordshire,utla,2021-07-01,388,269.2857142857143,22.64 276 | E12000006,East of England,region,2021-07-01,1502,986.1428571428571,15.81 277 | E92000001,England,nation,2021-07-01,22948,17134.14285714286,30.44 278 | E10000015,Hertfordshire,utla,2021-07-02,336,286.2857142857143,24.07 279 | E12000006,East of England,region,2021-07-02,1359,1074,17.22 280 | E92000001,England,nation,2021-07-02,22393,18404.85714285714,32.7 281 | E10000015,Hertfordshire,utla,2021-07-03,330,301.42857142857144,25.34 282 | E12000006,East of England,region,2021-07-03,1326,1157.4285714285713,18.56 283 | E92000001,England,nation,2021-07-03,21317,19287.85714285714,34.27 284 | E10000015,Hertfordshire,utla,2021-07-04,390,327.7142857142857,27.55 285 | E12000006,East of England,region,2021-07-04,1451,1265.857142857143,20.3 286 | E92000001,England,nation,2021-07-04,20454,20558.428571428572,36.52 287 | E10000015,Hertfordshire,utla,2021-07-05,368,336.57142857142856,28.29 288 | E12000006,East of England,region,2021-07-05,1703,1344.857142857143,21.57 289 | E92000001,England,nation,2021-07-05,23286,21213.285714285714,37.69 290 | E10000015,Hertfordshire,utla,2021-07-06,597,381.57142857142856,32.08 291 | E12000006,East of England,region,2021-07-06,2285,1521.142857142857,24.39 292 | E92000001,England,nation,2021-07-06,25295,22426.571428571428,39.84 293 | E10000015,Hertfordshire,utla,2021-07-07,484,413.2857142857143,34.74 294 | E12000006,East of England,region,2021-07-07,2155,1683,26.99 295 | E92000001,England,nation,2021-07-07,27516,23315.571428571428,41.42 296 | E10000015,Hertfordshire,utla,2021-07-08,483,426.85714285714283,35.88 297 | E12000006,East of England,region,2021-07-08,1919,1742.5714285714287,27.94 298 | E92000001,England,nation,2021-07-08,28421,24097.428571428572,42.81 299 | E10000015,Hertfordshire,utla,2021-07-09,572,460.57142857142856,38.72 300 | E12000006,East of England,region,2021-07-09,2500,1905.5714285714287,30.56 301 | E92000001,England,nation,2021-07-09,31231,25360,45.05 302 | E10000015,Hertfordshire,utla,2021-07-10,566,494.2857142857143,41.55 303 | E12000006,East of England,region,2021-07-10,2386,2057,32.99 304 | E92000001,England,nation,2021-07-10,29732,26562.14285714286,47.19 305 | E10000015,Hertfordshire,utla,2021-07-11,568,519.7142857142857,43.69 306 | E12000006,East of England,region,2021-07-11,2097,2149.285714285714,34.47 307 | E92000001,England,nation,2021-07-11,28421,27700.285714285714,49.21 308 | E10000015,Hertfordshire,utla,2021-07-12,558,546.8571428571429,45.97 309 | E12000006,East of England,region,2021-07-12,2211,2221.8571428571427,35.63 310 | E92000001,England,nation,2021-07-12,30619,28747.85714285714,51.07 311 | E10000015,Hertfordshire,utla,2021-07-13,716,563.8571428571429,47.4 312 | E12000006,East of England,region,2021-07-13,2833,2300.1428571428573,36.88 313 | E92000001,England,nation,2021-07-13,32883,29831.85714285714,53 314 | E10000015,Hertfordshire,utla,2021-07-14,703,595.1428571428571,50.03 315 | E12000006,East of England,region,2021-07-14,3182,2446.8571428571427,39.24 316 | E92000001,England,nation,2021-07-14,37895,31314.571428571428,55.63 317 | E10000015,Hertfordshire,utla,2021-07-15,955,662.5714285714286,55.7 318 | E12000006,East of England,region,2021-07-15,3921,2732.8571428571427,43.82 319 | E92000001,England,nation,2021-07-15,44523,33614.857142857145,59.72 320 | E10000015,Hertfordshire,utla,2021-07-16,876,706,59.35 321 | E12000006,East of England,region,2021-07-16,4186,2973.714285714286,47.69 322 | E92000001,England,nation,2021-07-16,47360,35919,63.81 323 | E10000015,Hertfordshire,utla,2021-07-17,1040,773.7142857142857,65.04 324 | E12000006,East of England,region,2021-07-17,4508,3276.8571428571427,52.55 325 | E92000001,England,nation,2021-07-17,50955,38950.857142857145,69.2 326 | E10000015,Hertfordshire,utla,2021-07-18,893,820.1428571428571,68.95 327 | E12000006,East of England,region,2021-07-18,3829,3524.285714285714,56.51 328 | E92000001,England,nation,2021-07-18,44777,41287.42857142857,73.35 329 | E10000015,Hertfordshire,utla,2021-07-19,476,808.4285714285714,67.96 330 | E12000006,East of England,region,2021-07-19,2249,3529.714285714286,56.6 331 | E92000001,England,nation,2021-07-19,34657,41864.28571428572,74.38 332 | E10000015,Hertfordshire,utla,2021-07-20,1440,911.8571428571429,76.66 333 | E12000006,East of England,region,2021-07-20,5784,3951.285714285714,63.36 334 | E92000001,England,nation,2021-07-20,43261,43346.857142857145,77.01 335 | E10000015,Hertfordshire,utla,2021-07-21,702,911.7142857142857,76.65 336 | E12000006,East of England,region,2021-07-21,3729,4029.4285714285716,64.61 337 | E92000001,England,nation,2021-07-21,39504,43576.71428571428,77.42 338 | E10000015,Hertfordshire,utla,2021-07-22,742,881.2857142857143,74.09 339 | E12000006,East of England,region,2021-07-22,3186,3924.4285714285716,62.93 340 | E92000001,England,nation,2021-07-22,35939,42350.42857142857,75.24 341 | E10000015,Hertfordshire,utla,2021-07-23,738,861.5714285714286,72.43 342 | E12000006,East of England,region,2021-07-23,3081,3766.5714285714284,60.4 343 | E92000001,England,nation,2021-07-23,32792,40269.28571428572,71.54 344 | E10000015,Hertfordshire,utla,2021-07-24,650,805.8571428571429,67.75 345 | E12000006,East of England,region,2021-07-24,2816,3524.8571428571427,56.52 346 | E92000001,England,nation,2021-07-24,28968,37128.28571428572,65.96 347 | E10000015,Hertfordshire,utla,2021-07-25,524,753.1428571428571,63.31 348 | E12000006,East of England,region,2021-07-25,2378,3317.5714285714284,53.2 349 | E92000001,England,nation,2021-07-25,25434,34365,61.05 350 | E10000015,Hertfordshire,utla,2021-07-26,402,742.5714285714286,62.43 351 | E12000006,East of England,region,2021-07-26,2078,3293.1428571428573,52.81 352 | E92000001,England,nation,2021-07-26,22181,32582.714285714286,57.89 353 | E10000015,Hertfordshire,utla,2021-07-27,458,602.2857142857143,50.63 354 | E12000006,East of England,region,2021-07-27,2004,2753.1428571428573,44.15 355 | E92000001,England,nation,2021-07-27,20290,29301.14285714286,52.06 356 | E10000015,Hertfordshire,utla,2021-07-28,501,573.5714285714286,48.22 357 | E12000006,East of England,region,2021-07-28,2276,2545.5714285714284,40.82 358 | E92000001,England,nation,2021-07-28,24367,27138.714285714286,48.21 359 | E10000015,Hertfordshire,utla,2021-07-29,557,547.1428571428571,46 360 | E12000006,East of England,region,2021-07-29,2637,2467.1428571428573,39.56 361 | E92000001,England,nation,2021-07-29,27524,25936.571428571428,46.08 362 | E10000015,Hertfordshire,utla,2021-07-30,449,505.85714285714283,42.53 363 | E12000006,East of England,region,2021-07-30,2462,2378.714285714286,38.14 364 | E92000001,England,nation,2021-07-30,26241,25000.714285714286,44.42 365 | E10000015,Hertfordshire,utla,2021-07-31,438,475.57142857142856,39.98 366 | E12000006,East of England,region,2021-07-31,2074,2272.714285714286,36.44 367 | E92000001,England,nation,2021-07-31,23949,24283.714285714286,43.14 368 | E10000015,Hertfordshire,utla,2021-08-01,441,463.7142857142857,38.98 369 | E12000006,East of England,region,2021-08-01,2084,2230.714285714286,35.77 370 | E92000001,England,nation,2021-08-01,21645,23742.428571428572,42.18 371 | E10000015,Hertfordshire,utla,2021-08-02,431,467.85714285714283,39.33 372 | E12000006,East of England,region,2021-08-02,2060,2228.1428571428573,35.73 373 | E92000001,England,nation,2021-08-02,19175,23313,41.42 374 | E10000015,Hertfordshire,utla,2021-08-03,384,457.2857142857143,38.44 375 | E12000006,East of England,region,2021-08-03,1820,2201.8571428571427,35.31 376 | E92000001,England,nation,2021-08-03,19012,23130.428571428572,41.09 377 | E10000015,Hertfordshire,utla,2021-08-04,573,467.57142857142856,39.31 378 | E12000006,East of England,region,2021-08-04,2678,2259.285714285714,36.23 379 | E92000001,England,nation,2021-08-04,26393,23419.85714285714,41.61 380 | E10000015,Hertfordshire,utla,2021-08-05,619,476.42857142857144,40.05 381 | E12000006,East of England,region,2021-08-05,2572,2250,36.08 382 | E92000001,England,nation,2021-08-05,26512,23275.285714285714,41.35 383 | E10000015,Hertfordshire,utla,2021-08-06,526,487.42857142857144,40.98 384 | E12000006,East of England,region,2021-08-06,2718,2286.5714285714284,36.67 385 | E92000001,England,nation,2021-08-06,28321,23572.428571428572,41.88 386 | E10000015,Hertfordshire,utla,2021-08-07,543,502.42857142857144,42.24 387 | E12000006,East of England,region,2021-08-07,2399,2333,37.41 388 | E92000001,England,nation,2021-08-07,25877,23847.85714285714,42.37 389 | E10000015,Hertfordshire,utla,2021-08-08,458,504.85714285714283,42.44 390 | E12000006,East of England,region,2021-08-08,2167,2344.8571428571427,37.6 391 | E92000001,England,nation,2021-08-08,24196,24212.285714285714,43.02 392 | E10000015,Hertfordshire,utla,2021-08-09,427,504.2857142857143,42.39 393 | E12000006,East of England,region,2021-08-09,2084,2348.285714285714,37.66 394 | E92000001,England,nation,2021-08-09,21915,24603.714285714286,43.71 395 | E10000015,Hertfordshire,utla,2021-08-10,362,501.14285714285717,42.13 396 | E12000006,East of England,region,2021-08-10,1909,2361,37.86 397 | E92000001,England,nation,2021-08-10,20630,24834.85714285714,44.12 398 | E10000015,Hertfordshire,utla,2021-08-11,532,495.2857142857143,41.64 399 | E12000006,East of England,region,2021-08-11,2500,2335.5714285714284,37.45 400 | E92000001,England,nation,2021-08-11,26647,24871.14285714286,44.19 401 | E10000015,Hertfordshire,utla,2021-08-12,636,497.7142857142857,41.84 402 | E12000006,East of England,region,2021-08-12,2861,2376.8571428571427,38.11 403 | E92000001,England,nation,2021-08-12,28093,25097,44.59 404 | E10000015,Hertfordshire,utla,2021-08-13,615,510.42857142857144,42.91 405 | E12000006,East of England,region,2021-08-13,2804,2389.1428571428573,38.31 406 | E92000001,England,nation,2021-08-13,28679,25148.14285714286,44.68 407 | E10000015,Hertfordshire,utla,2021-08-14,543,510.42857142857144,42.91 408 | E12000006,East of England,region,2021-08-14,2402,2389.5714285714284,38.32 409 | E92000001,England,nation,2021-08-14,26700,25265.714285714286,44.89 410 | E10000015,Hertfordshire,utla,2021-08-15,426,505.85714285714283,42.53 411 | E12000006,East of England,region,2021-08-15,2002,2366,37.94 412 | E92000001,England,nation,2021-08-15,22859,25074.714285714286,44.55 413 | E10000015,Hertfordshire,utla,2021-08-16,403,502.42857142857144,42.24 414 | E12000006,East of England,region,2021-08-16,2221,2385.5714285714284,38.25 415 | E92000001,England,nation,2021-08-16,23171,25254.14285714286,44.87 416 | E10000015,Hertfordshire,utla,2021-08-17,483,519.7142857142857,43.69 417 | E12000006,East of England,region,2021-08-17,2267,2436.714285714286,39.07 418 | E92000001,England,nation,2021-08-17,22712,25551.571428571428,45.4 419 | E10000015,Hertfordshire,utla,2021-08-18,505,515.8571428571429,43.37 420 | E12000006,East of England,region,2021-08-18,2496,2436.1428571428573,39.07 421 | E92000001,England,nation,2021-08-18,28648,25837.428571428572,45.9 422 | E10000015,Hertfordshire,utla,2021-08-19,557,504.57142857142856,42.42 423 | E12000006,East of England,region,2021-08-19,2431,2374.714285714286,38.08 424 | E92000001,England,nation,2021-08-19,29762,26075.85714285714,46.33 425 | E10000015,Hertfordshire,utla,2021-08-20,579,499.42857142857144,41.99 426 | E12000006,East of England,region,2021-08-20,2848,2381,38.18 427 | E92000001,England,nation,2021-08-20,29576,26204,46.55 428 | E10000015,Hertfordshire,utla,2021-08-21,573,503.7142857142857,42.35 429 | E12000006,East of England,region,2021-08-21,2583,2406.8571428571427,38.6 430 | E92000001,England,nation,2021-08-21,26982,26244.285714285714,46.63 431 | E10000015,Hertfordshire,utla,2021-08-22,558,522.5714285714286,43.93 432 | E12000006,East of England,region,2021-08-22,2707,2507.5714285714284,40.21 433 | E92000001,England,nation,2021-08-22,25952,26686.14285714286,47.41 434 | E10000015,Hertfordshire,utla,2021-08-23,411,523.7142857142857,44.03 435 | E12000006,East of England,region,2021-08-23,2273,2515,40.33 436 | E92000001,England,nation,2021-08-23,24158,26827.14285714286,47.66 437 | E10000015,Hertfordshire,utla,2021-08-24,426,515.5714285714286,43.34 438 | E12000006,East of England,region,2021-08-24,2064,2486,39.86 439 | E92000001,England,nation,2021-08-24,23474,26936,47.85 440 | E10000015,Hertfordshire,utla,2021-08-25,508,516,43.38 441 | E12000006,East of England,region,2021-08-25,2697,2514.714285714286,40.33 442 | E92000001,England,nation,2021-08-25,27350,26750.571428571428,47.53 443 | E10000015,Hertfordshire,utla,2021-08-26,575,518.5714285714286,43.6 444 | E12000006,East of England,region,2021-08-26,2784,2565.1428571428573,41.13 445 | E92000001,England,nation,2021-08-26,29417,26701.285714285714,47.44 446 | E10000015,Hertfordshire,utla,2021-08-27,485,505.14285714285717,42.47 447 | E12000006,East of England,region,2021-08-27,2596,2529.1428571428573,40.56 448 | E92000001,England,nation,2021-08-27,27545,26411.14285714286,46.92 449 | E10000015,Hertfordshire,utla,2021-08-28,477,491.42857142857144,41.31 450 | E12000006,East of England,region,2021-08-28,2278,2485.5714285714284,39.86 451 | E92000001,England,nation,2021-08-28,25118,26144.85714285714,46.45 452 | E10000015,Hertfordshire,utla,2021-08-29,464,478,40.18 453 | E12000006,East of England,region,2021-08-29,2197,2412.714285714286,38.69 454 | E92000001,England,nation,2021-08-29,22501,25651.85714285714,45.57 455 | E10000015,Hertfordshire,utla,2021-08-30,393,475.42857142857144,39.97 456 | E12000006,East of England,region,2021-08-30,2147,2394.714285714286,38.4 457 | E92000001,England,nation,2021-08-30,21324,25247,44.85 458 | E10000015,Hertfordshire,utla,2021-08-31,415,473.85714285714283,39.84 459 | E12000006,East of England,region,2021-08-31,2048,2392.4285714285716,38.36 460 | E92000001,England,nation,2021-08-31,20967,24888.85714285714,44.22 461 | E10000015,Hertfordshire,utla,2021-09-01,562,481.57142857142856,40.48 462 | E12000006,East of England,region,2021-09-01,2662,2387.4285714285716,38.28 463 | E92000001,England,nation,2021-09-01,24723,24513.571428571428,43.55 464 | E10000015,Hertfordshire,utla,2021-09-02,483,468.42857142857144,39.38 465 | E12000006,East of England,region,2021-09-02,2187,2302.1428571428573,36.92 466 | E92000001,England,nation,2021-09-02,28686,24409.14285714286,43.37 467 | E10000015,Hertfordshire,utla,2021-09-03,775,509.85714285714283,42.86 468 | E12000006,East of England,region,2021-09-03,3597,2445.1428571428573,39.21 469 | E92000001,England,nation,2021-09-03,31726,25006.428571428572,44.43 470 | E10000015,Hertfordshire,utla,2021-09-04,621,530.4285714285714,44.59 471 | E12000006,East of England,region,2021-09-04,2674,2501.714285714286,40.12 472 | E92000001,England,nation,2021-09-04,29614,25648.714285714286,45.57 473 | E10000015,Hertfordshire,utla,2021-09-05,651,557.1428571428571,46.84 474 | E12000006,East of England,region,2021-09-05,3009,2617.714285714286,41.98 475 | E92000001,England,nation,2021-09-05,27022,26294.571428571428,46.72 476 | E10000015,Hertfordshire,utla,2021-09-06,520,575.2857142857143,48.36 477 | E12000006,East of England,region,2021-09-06,2841,2716.8571428571427,43.57 478 | E92000001,England,nation,2021-09-06,27202,27134.285714285714,48.21 479 | E10000015,Hertfordshire,utla,2021-09-07,469,583,49.01 480 | E12000006,East of England,region,2021-09-07,2545,2787.8571428571427,44.71 481 | E92000001,England,nation,2021-09-07,27545,28074,49.88 482 | E10000015,Hertfordshire,utla,2021-09-08,628,592.4285714285714,49.8 483 | E12000006,East of England,region,2021-09-08,2875,2818.285714285714,45.19 484 | E92000001,England,nation,2021-09-08,29286,28725.85714285714,51.03 485 | E10000015,Hertfordshire,utla,2021-09-09,509,596.1428571428571,50.12 486 | E12000006,East of England,region,2021-09-09,2813,2907.714285714286,46.63 487 | E92000001,England,nation,2021-09-09,27049,28492,50.62 488 | E10000015,Hertfordshire,utla,2021-09-10,442,548.5714285714286,46.12 489 | E12000006,East of England,region,2021-09-10,2566,2760.4285714285716,44.27 490 | E92000001,England,nation,2021-09-10,26653,27767.285714285714,49.33 491 | E10000015,Hertfordshire,utla,2021-09-11,446,523.5714285714286,44.02 492 | E12000006,East of England,region,2021-09-11,2329,2711.1428571428573,43.48 493 | E92000001,England,nation,2021-09-11,23825,26940.285714285714,47.86 494 | E10000015,Hertfordshire,utla,2021-09-12,401,487.85714285714283,41.01 495 | E12000006,East of England,region,2021-09-12,1914,2554.714285714286,40.97 496 | E92000001,England,nation,2021-09-12,19913,25924.714285714286,46.06 497 | E10000015,Hertfordshire,utla,2021-09-13,410,472.14285714285717,39.69 498 | E12000006,East of England,region,2021-09-13,2192,2462,39.48 499 | E92000001,England,nation,2021-09-13,21077,25049.714285714286,44.5 500 | E10000015,Hertfordshire,utla,2021-09-14,413,464.14285714285717,39.02 501 | E12000006,East of England,region,2021-09-14,1956,2377.8571428571427,38.13 502 | E92000001,England,nation,2021-09-14,19739,23934.571428571428,42.52 503 | E10000015,Hertfordshire,utla,2021-09-15,396,431,36.23 504 | E12000006,East of England,region,2021-09-15,2274,2292,36.75 505 | E92000001,England,nation,2021-09-15,22078,22904.85714285714,40.69 506 | E10000015,Hertfordshire,utla,2021-09-16,521,432.7142857142857,36.38 507 | E12000006,East of England,region,2021-09-16,2386,2231,35.78 508 | E92000001,England,nation,2021-09-16,22949,22319.14285714286,39.65 509 | E10000015,Hertfordshire,utla,2021-09-17,499,440.85714285714283,37.06 510 | E12000006,East of England,region,2021-09-17,2217,2181.1428571428573,34.98 511 | E92000001,England,nation,2021-09-17,23265,21835.14285714286,38.79 512 | E10000015,Hertfordshire,utla,2021-09-18,482,446,37.49 513 | E12000006,East of England,region,2021-09-18,2295,2176.285714285714,34.9 514 | E92000001,England,nation,2021-09-18,22956,21711,38.57 515 | E10000015,Hertfordshire,utla,2021-09-19,443,452,38 516 | E12000006,East of England,region,2021-09-19,1997,2188.1428571428573,35.09 517 | E92000001,England,nation,2021-09-19,22173,22033.85714285714,39.15 518 | E10000015,Hertfordshire,utla,2021-09-20,651,486.42857142857144,40.89 519 | E12000006,East of England,region,2021-09-20,2995,2302.8571428571427,36.93 520 | E92000001,England,nation,2021-09-20,26905,22866.428571428572,40.62 521 | E10000015,Hertfordshire,utla,2021-09-21,524,502.2857142857143,42.23 522 | E12000006,East of England,region,2021-09-21,2525,2384.1428571428573,38.23 523 | E92000001,England,nation,2021-09-21,24973,23614.14285714286,41.95 524 | E10000015,Hertfordshire,utla,2021-09-22,560,525.7142857142857,44.2 525 | E12000006,East of England,region,2021-09-22,2442,2408.1428571428573,38.62 526 | E92000001,England,nation,2021-09-22,27317,24362.571428571428,43.28 527 | E10000015,Hertfordshire,utla,2021-09-23,632,541.5714285714286,45.53 528 | E12000006,East of England,region,2021-09-23,3205,2525.1428571428573,40.49 529 | E92000001,England,nation,2021-09-23,29045,25233.428571428572,44.83 530 | E10000015,Hertfordshire,utla,2021-09-24,464,536.5714285714286,45.11 531 | E12000006,East of England,region,2021-09-24,2588,2578.1428571428573,41.34 532 | E92000001,England,nation,2021-09-24,28199,25938.285714285714,46.08 533 | E10000015,Hertfordshire,utla,2021-09-25,542,545.1428571428571,45.83 534 | E12000006,East of England,region,2021-09-25,2763,2645,42.41 535 | E92000001,England,nation,2021-09-25,28087,26671.285714285714,47.38 536 | E10000015,Hertfordshire,utla,2021-09-26,469,548.8571428571429,46.14 537 | E12000006,East of England,region,2021-09-26,2655,2739,43.92 538 | E92000001,England,nation,2021-09-26,25538,27152,48.24 539 | E10000015,Hertfordshire,utla,2021-09-27,758,564.1428571428571,47.43 540 | E12000006,East of England,region,2021-09-27,3438,2802.285714285714,44.94 541 | E92000001,England,nation,2021-09-27,29329,27498.285714285714,48.85 542 | E10000015,Hertfordshire,utla,2021-09-28,601,575.1428571428571,48.35 543 | E12000006,East of England,region,2021-09-28,3389,2925.714285714286,46.92 544 | E92000001,England,nation,2021-09-28,28808,28046.14285714286,49.83 545 | E10000015,Hertfordshire,utla,2021-09-29,697,594.7142857142857,50 546 | E12000006,East of England,region,2021-09-29,3009,3006.714285714286,48.21 547 | E92000001,England,nation,2021-09-29,29036,28291.714285714286,50.26 548 | E10000015,Hertfordshire,utla,2021-09-30,699,604.2857142857143,50.8 549 | E12000006,East of England,region,2021-09-30,3410,3036,48.68 550 | E92000001,England,nation,2021-09-30,29826,28403.285714285714,50.46 551 | E10000015,Hertfordshire,utla,2021-10-01,518,612,51.45 552 | E12000006,East of England,region,2021-10-01,2822,3069.4285714285716,49.22 553 | E92000001,England,nation,2021-10-01,28836,28494.285714285714,50.62 554 | E10000015,Hertfordshire,utla,2021-10-02,515,608.1428571428571,51.13 555 | E12000006,East of England,region,2021-10-02,2632,3050.714285714286,48.92 556 | E92000001,England,nation,2021-10-02,26794,28309.571428571428,50.3 557 | E10000015,Hertfordshire,utla,2021-10-03,568,622.2857142857143,52.31 558 | E12000006,East of England,region,2021-10-03,2573,3039,48.73 559 | E92000001,England,nation,2021-10-03,25176,28257.85714285714,50.2 560 | E10000015,Hertfordshire,utla,2021-10-04,634,604.5714285714286,50.82 561 | E12000006,East of England,region,2021-10-04,3224,3008.4285714285716,48.24 562 | E92000001,England,nation,2021-10-04,28251,28103.85714285714,49.93 563 | E10000015,Hertfordshire,utla,2021-10-05,761,627.4285714285714,52.75 564 | E12000006,East of England,region,2021-10-05,3229,2985.5714285714284,47.88 565 | E92000001,England,nation,2021-10-05,28846,28109.285714285714,49.94 566 | E10000015,Hertfordshire,utla,2021-10-06,798,641.8571428571429,53.96 567 | E12000006,East of England,region,2021-10-06,3636,3075.1428571428573,49.31 568 | E92000001,England,nation,2021-10-06,33450,28739.85714285714,51.06 569 | E10000015,Hertfordshire,utla,2021-10-07,700,642,53.97 570 | E12000006,East of England,region,2021-10-07,3958,3153.4285714285716,50.57 571 | E92000001,England,nation,2021-10-07,33305,29236.85714285714,51.94 572 | E10000015,Hertfordshire,utla,2021-10-08,780,679.4285714285714,57.12 573 | E12000006,East of England,region,2021-10-08,3633,3269.285714285714,52.43 574 | E92000001,England,nation,2021-10-08,32157,29711.285714285714,52.79 575 | E10000015,Hertfordshire,utla,2021-10-09,668,701.2857142857143,58.96 576 | E12000006,East of England,region,2021-10-09,3537,3398.5714285714284,54.5 577 | E92000001,England,nation,2021-10-09,31259,30349.14285714286,53.92 578 | E10000015,Hertfordshire,utla,2021-10-10,701,720.2857142857143,60.55 579 | E12000006,East of England,region,2021-10-10,3543,3537.1428571428573,56.72 580 | E92000001,England,nation,2021-10-10,31096,31194.85714285714,55.42 581 | E10000015,Hertfordshire,utla,2021-10-11,707,730.7142857142857,61.43 582 | E12000006,East of England,region,2021-10-11,4097,3661.8571428571427,58.72 583 | E92000001,England,nation,2021-10-11,32349,31780.285714285714,56.46 584 | E10000015,Hertfordshire,utla,2021-10-12,781,733.5714285714286,61.67 585 | E12000006,East of England,region,2021-10-12,3878,3754.5714285714284,60.21 586 | E92000001,England,nation,2021-10-12,33287,32414.714285714286,57.59 587 | E10000015,Hertfordshire,utla,2021-10-13,700,719.5714285714286,60.49 588 | E12000006,East of England,region,2021-10-13,4161,3829.5714285714284,61.41 589 | E92000001,England,nation,2021-10-13,36458,32844.42857142857,58.35 590 | E10000015,Hertfordshire,utla,2021-10-14,711,721.1428571428571,60.62 591 | E12000006,East of England,region,2021-10-14,4385,3890.5714285714284,62.39 592 | E92000001,England,nation,2021-10-14,38488,33584.857142857145,59.67 593 | E10000015,Hertfordshire,utla,2021-10-15,688,708,59.52 594 | E12000006,East of England,region,2021-10-15,4068,3952.714285714286,63.38 595 | E92000001,England,nation,2021-10-15,37691,34375.42857142857,61.07 596 | E10000015,Hertfordshire,utla,2021-10-16,935,746.1428571428571,62.73 597 | E12000006,East of England,region,2021-10-16,4677,4115.571428571428,66 598 | E92000001,England,nation,2021-10-16,39624,35570.42857142857,63.19 599 | E10000015,Hertfordshire,utla,2021-10-17,759,754.4285714285714,63.42 600 | E12000006,East of England,region,2021-10-17,4110,4196.571428571428,67.3 601 | E92000001,England,nation,2021-10-17,38543,36634.28571428572,65.08 602 | E10000015,Hertfordshire,utla,2021-10-18,935,787,66.16 603 | E12000006,East of England,region,2021-10-18,4936,4316.428571428572,69.22 604 | E92000001,England,nation,2021-10-18,39473,37652,66.89 605 | E10000015,Hertfordshire,utla,2021-10-19,834,794.5714285714286,66.8 606 | E12000006,East of England,region,2021-10-19,4330,4381,70.25 607 | E92000001,England,nation,2021-10-19,36712,38141.28571428572,67.76 608 | E10000015,Hertfordshire,utla,2021-10-20,1012,839.1428571428571,70.54 609 | E12000006,East of England,region,2021-10-20,4752,4465.428571428572,71.61 610 | E92000001,England,nation,2021-10-20,41498,38861.28571428572,69.04 611 | E10000015,Hertfordshire,utla,2021-10-21,1075,891.1428571428571,74.92 612 | E12000006,East of England,region,2021-10-21,5592,4637.857142857143,74.37 613 | E92000001,England,nation,2021-10-21,44363,39700.57142857143,70.53 614 | -------------------------------------------------------------------------------- /custom.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "color": [ 4 | "#005eb9", 5 | "#59c4e6", 6 | "#072d72", 7 | "#00d1b5", 8 | "#a3ef74", 9 | "#fca03a" 10 | ], 11 | "backgroundColor": "rgba(0,0,0,0)", 12 | "textStyle": {}, 13 | "title": { 14 | "textStyle": { 15 | "color": "#005eb9" 16 | }, 17 | "subtextStyle": { 18 | "color": "#93b7e3" 19 | } 20 | }, 21 | "line": { 22 | "itemStyle": { 23 | "borderWidth": "2" 24 | }, 25 | "lineStyle": { 26 | "width": "1" 27 | }, 28 | "symbolSize": "5", 29 | "symbol": "circle", 30 | "smooth": false 31 | }, 32 | "radar": { 33 | "itemStyle": { 34 | "borderWidth": "2" 35 | }, 36 | "lineStyle": { 37 | "width": "1" 38 | }, 39 | "symbolSize": "5", 40 | "symbol": "circle", 41 | "smooth": false 42 | }, 43 | "bar": { 44 | "itemStyle": { 45 | "barBorderWidth": 0, 46 | "barBorderColor": "#ccc" 47 | } 48 | }, 49 | "pie": { 50 | "itemStyle": { 51 | "borderWidth": 0, 52 | "borderColor": "#ccc" 53 | } 54 | }, 55 | "scatter": { 56 | "itemStyle": { 57 | "borderWidth": 0, 58 | "borderColor": "#ccc" 59 | } 60 | }, 61 | "boxplot": { 62 | "itemStyle": { 63 | "borderWidth": 0, 64 | "borderColor": "#ccc" 65 | } 66 | }, 67 | "parallel": { 68 | "itemStyle": { 69 | "borderWidth": 0, 70 | "borderColor": "#ccc" 71 | } 72 | }, 73 | "sankey": { 74 | "itemStyle": { 75 | "borderWidth": 0, 76 | "borderColor": "#ccc" 77 | } 78 | }, 79 | "funnel": { 80 | "itemStyle": { 81 | "borderWidth": 0, 82 | "borderColor": "#ccc" 83 | } 84 | }, 85 | "gauge": { 86 | "itemStyle": { 87 | "borderWidth": 0, 88 | "borderColor": "#ccc" 89 | } 90 | }, 91 | "candlestick": { 92 | "itemStyle": { 93 | "color": "#edafda", 94 | "color0": "transparent", 95 | "borderColor": "#d680bc", 96 | "borderColor0": "#8fd3e8", 97 | "borderWidth": "2" 98 | } 99 | }, 100 | "graph": { 101 | "itemStyle": { 102 | "borderWidth": 0, 103 | "borderColor": "#ccc" 104 | }, 105 | "lineStyle": { 106 | "width": 1, 107 | "color": "#aaa" 108 | }, 109 | "symbolSize": "5", 110 | "symbol": "circle", 111 | "smooth": false, 112 | "color": [ 113 | "#005eb9", 114 | "#59c4e6", 115 | "#072d72", 116 | "#00d1b5", 117 | "#a3ef74", 118 | "#fca03a" 119 | ], 120 | "label": { 121 | "color": "#eee" 122 | } 123 | }, 124 | "map": { 125 | "itemStyle": { 126 | "areaColor": "#f3f3f3", 127 | "borderColor": "#516b91", 128 | "borderWidth": 0.5 129 | }, 130 | "label": { 131 | "color": "#000" 132 | }, 133 | "emphasis": { 134 | "itemStyle": { 135 | "areaColor": "#a5e7f0", 136 | "borderColor": "#516b91", 137 | "borderWidth": 1 138 | }, 139 | "label": { 140 | "color": "#516b91" 141 | } 142 | } 143 | }, 144 | "geo": { 145 | "itemStyle": { 146 | "areaColor": "#f3f3f3", 147 | "borderColor": "#516b91", 148 | "borderWidth": 0.5 149 | }, 150 | "label": { 151 | "color": "#000" 152 | }, 153 | "emphasis": { 154 | "itemStyle": { 155 | "areaColor": "#a5e7f0", 156 | "borderColor": "#516b91", 157 | "borderWidth": 1 158 | }, 159 | "label": { 160 | "color": "#516b91" 161 | } 162 | } 163 | }, 164 | "categoryAxis": { 165 | "axisLine": { 166 | "show": true, 167 | "lineStyle": { 168 | "color": "#cccccc" 169 | } 170 | }, 171 | "axisTick": { 172 | "show": false, 173 | "lineStyle": { 174 | "color": "#333" 175 | } 176 | }, 177 | "axisLabel": { 178 | "show": true, 179 | "color": "#999999" 180 | }, 181 | "splitLine": { 182 | "show": true, 183 | "lineStyle": { 184 | "color": [ 185 | "#eeeeee" 186 | ] 187 | } 188 | }, 189 | "splitArea": { 190 | "show": false, 191 | "areaStyle": { 192 | "color": [ 193 | "rgba(250,250,250,0.05)", 194 | "rgba(200,200,200,0.02)" 195 | ] 196 | } 197 | } 198 | }, 199 | "valueAxis": { 200 | "axisLine": { 201 | "show": true, 202 | "lineStyle": { 203 | "color": "#cccccc" 204 | } 205 | }, 206 | "axisTick": { 207 | "show": false, 208 | "lineStyle": { 209 | "color": "#333" 210 | } 211 | }, 212 | "axisLabel": { 213 | "show": true, 214 | "color": "#999999" 215 | }, 216 | "splitLine": { 217 | "show": true, 218 | "lineStyle": { 219 | "color": [ 220 | "#eeeeee" 221 | ] 222 | } 223 | }, 224 | "splitArea": { 225 | "show": false, 226 | "areaStyle": { 227 | "color": [ 228 | "rgba(250,250,250,0.05)", 229 | "rgba(200,200,200,0.02)" 230 | ] 231 | } 232 | } 233 | }, 234 | "logAxis": { 235 | "axisLine": { 236 | "show": true, 237 | "lineStyle": { 238 | "color": "#cccccc" 239 | } 240 | }, 241 | "axisTick": { 242 | "show": false, 243 | "lineStyle": { 244 | "color": "#333" 245 | } 246 | }, 247 | "axisLabel": { 248 | "show": true, 249 | "color": "#999999" 250 | }, 251 | "splitLine": { 252 | "show": true, 253 | "lineStyle": { 254 | "color": [ 255 | "#eeeeee" 256 | ] 257 | } 258 | }, 259 | "splitArea": { 260 | "show": false, 261 | "areaStyle": { 262 | "color": [ 263 | "rgba(250,250,250,0.05)", 264 | "rgba(200,200,200,0.02)" 265 | ] 266 | } 267 | } 268 | }, 269 | "timeAxis": { 270 | "axisLine": { 271 | "show": true, 272 | "lineStyle": { 273 | "color": "#cccccc" 274 | } 275 | }, 276 | "axisTick": { 277 | "show": false, 278 | "lineStyle": { 279 | "color": "#333" 280 | } 281 | }, 282 | "axisLabel": { 283 | "show": true, 284 | "color": "#999999" 285 | }, 286 | "splitLine": { 287 | "show": true, 288 | "lineStyle": { 289 | "color": [ 290 | "#eeeeee" 291 | ] 292 | } 293 | }, 294 | "splitArea": { 295 | "show": false, 296 | "areaStyle": { 297 | "color": [ 298 | "rgba(250,250,250,0.05)", 299 | "rgba(200,200,200,0.02)" 300 | ] 301 | } 302 | } 303 | }, 304 | "toolbox": { 305 | "iconStyle": { 306 | "borderColor": "#999" 307 | }, 308 | "emphasis": { 309 | "iconStyle": { 310 | "borderColor": "#666" 311 | } 312 | } 313 | }, 314 | "legend": { 315 | "textStyle": { 316 | "color": "#999999" 317 | } 318 | }, 319 | "tooltip": { 320 | "axisPointer": { 321 | "lineStyle": { 322 | "color": "#ccc", 323 | "width": 1 324 | }, 325 | "crossStyle": { 326 | "color": "#ccc", 327 | "width": 1 328 | } 329 | } 330 | }, 331 | "timeline": { 332 | "lineStyle": { 333 | "color": "#8fd3e8", 334 | "width": 1 335 | }, 336 | "itemStyle": { 337 | "color": "#8fd3e8", 338 | "borderWidth": 1 339 | }, 340 | "controlStyle": { 341 | "color": "#8fd3e8", 342 | "borderColor": "#8fd3e8", 343 | "borderWidth": 0.5 344 | }, 345 | "checkpointStyle": { 346 | "color": "#8fd3e8", 347 | "borderColor": "#8a7ca8" 348 | }, 349 | "label": { 350 | "color": "#8fd3e8" 351 | }, 352 | "emphasis": { 353 | "itemStyle": { 354 | "color": "#8fd3e8" 355 | }, 356 | "controlStyle": { 357 | "color": "#8fd3e8", 358 | "borderColor": "#8fd3e8", 359 | "borderWidth": 0.5 360 | }, 361 | "label": { 362 | "color": "#8fd3e8" 363 | } 364 | } 365 | }, 366 | "visualMap": { 367 | "color": [ 368 | "#516b91", 369 | "#59c4e6", 370 | "#a5e7f0" 371 | ] 372 | }, 373 | "dataZoom": { 374 | "backgroundColor": "rgba(0,0,0,0)", 375 | "dataBackgroundColor": "rgba(255,255,255,0.3)", 376 | "fillerColor": "rgba(167,183,204,0.4)", 377 | "handleColor": "#a7b7cc", 378 | "handleSize": "100%", 379 | "textStyle": { 380 | "color": "#333" 381 | } 382 | }, 383 | "markPoint": { 384 | "label": { 385 | "color": "#eee" 386 | }, 387 | "emphasis": { 388 | "label": { 389 | "color": "#eee" 390 | } 391 | } 392 | } 393 | } 394 | 395 | -------------------------------------------------------------------------------- /echarts/answer_sheet_echarts.R: -------------------------------------------------------------------------------- 1 | # ANSWER SHEET 2 | 3 | # Set up ------------------------------------------------------------------ 4 | 5 | library(tidyverse) 6 | library(plotly) 7 | library(echarts4r) 8 | library(rmarkdown) 9 | 10 | cases <- read_csv("covid_data.csv") 11 | 12 | # load in fake indicator data 13 | mh <- read_csv("mhtreatment_data.csv") 14 | 15 | # Single line plot ------------------------------------------------------- 16 | 17 | cases %>% 18 | filter(areaName == "England") %>% 19 | e_charts(x = date) %>% 20 | e_line(caseRate) 21 | 22 | # Grouped bar plot ------------------------------------------------------- 23 | 24 | cases %>% 25 | group_by(areaName) %>% 26 | e_charts(x = date) %>% 27 | e_line(caseRate) 28 | 29 | # Adding layers ----------------------------------------------------------- 30 | 31 | cases %>% 32 | filter(areaName == "England") %>% 33 | e_charts(x = date) %>% 34 | e_bar(newCasesByPublishDate) %>% 35 | e_line(rollingAvg) 36 | 37 | # Title, tooltip, legend -------------------------------------------------- 38 | 39 | #Task: Make an easy-to-read plot showing the number of Male patients in treatment for mental health 40 | #over time. As a comparison, plot the mean number in treatment last year as an additional line. 41 | 42 | mh %>% 43 | filter(Group == "Male") %>% # Male 44 | e_charts(Date) %>% # over time 45 | e_line(value) %>% 46 | e_tooltip(trigger = "axis") %>% #tooltip 47 | e_title("Male patients in treatment for mental health issues") %>% #add title 48 | e_legend(show = FALSE) %>% # remove legend as it's not needed 49 | e_line(mean, symbol = "none") #add mean line with symbol = "none" 50 | 51 | # Using additional arguments from JS ------------------------------------- 52 | 53 | mh %>% 54 | filter(Group == "Male") %>% 55 | e_charts(Date) %>% 56 | e_line(value, # within e_line (R equivalent of series: {type:line}) 57 | lineStyle = list( # lineStyle arg. we input a list of additional args WITHIN lineStyle 58 | color = "#fe213c" # color arg within lineStyle 59 | )) %>% 60 | e_tooltip(trigger = "axis") %>% #tooltip 61 | e_title("Male patients in treatment for mental health issues") %>% 62 | e_legend(show = FALSE) %>% 63 | e_line(mean, symbol = "none") 64 | 65 | # Exercise 2 -------------------------------------------------------------- 66 | 67 | # Using the mh dataset, make an SPC chart (line plot) showing count of male 68 | # mental health patients in treatment over time. Add an additional line for the 69 | # mean. Add two additional lines for the upper and lower confidence intervals. 70 | # Set the tooltip as “axis”. 71 | 72 | mh %>% 73 | filter(Group == "Male") %>% # filter to male patients 74 | e_charts(Date) %>%# over time 75 | e_line(value) %>% # first line layer for values 76 | e_line(mean, symbol = "none") %>% # second line layer for mean (without symbols) 77 | e_line(upper_ci, symbol = "none") %>% # third line for upper CI 78 | e_line(lower_ci, symbol = "none") %>% # fourth line for lower CI 79 | e_tooltip(trigger = "axis") 80 | 81 | # BONUS 1 82 | # Try adding a scatter layer (e_scatter) for counts that are outside the confidence intervals. 83 | # These values are kept in the “value_breach” column of the dataset. 84 | # To make it stand out from the line layer, add “symbolSize = 15” in the function to make it bigger. 85 | 86 | mh %>% 87 | filter(Group == "Male") %>% 88 | e_charts(Date) %>% 89 | e_line(value) %>% 90 | e_line(mean, symbol = "none") %>% 91 | e_line(upper_ci, symbol = "none") %>% 92 | e_line(lower_ci, symbol = "none") %>% 93 | e_scatter(value_breach, symbolSize = 15) %>% # add scatter layer with large symbolSize 94 | e_tooltip(trigger = "axis") 95 | 96 | # BONUS 2 (CHALLENGE) 97 | # By referring to the documentation here: https://echarts.apache.org/en/option.html#series-line.lineStyle.color 98 | # change the upper and lower CI layers to “#d53f58” and the mean layer to “#858585”. 99 | 100 | mh %>% 101 | filter(Group == "Male") %>% 102 | e_charts(Date) %>% 103 | e_line(value) %>% 104 | e_line(mean, symbol = "none", 105 | lineStyle = list(color = "#858585")) %>% # change mean to grey 106 | e_line(upper_ci, symbol = "none", 107 | lineStyle = list(color = "#d53f58")) %>% # change upper CI to red 108 | e_line(lower_ci, symbol = "none", 109 | lineStyle = list(color = "#d53f58")) %>% # change lower CI to red 110 | e_scatter(value_breach, symbolSize = 15) %>% 111 | e_tooltip(trigger = "axis") 112 | 113 | # EXTRA: Custom themes ---------------------------------------------------- 114 | 115 | # "westeros" theme 116 | mh %>% 117 | filter(Group == "Male") %>% # filter to male patients 118 | e_charts(Date) %>%# over time 119 | e_line(value) %>% # first line layer for values 120 | e_line(mean, symbol = "none") %>% # second line layer for mean (without symbols) 121 | e_line(upper_ci, symbol = "none") %>% # third line for upper CI 122 | e_line(lower_ci, symbol = "none") %>% # fourth line for lower CI 123 | e_tooltip(trigger = "axis") %>% 124 | e_theme("westeros") 125 | 126 | # use the custom.json theme provided 127 | mh %>% 128 | filter(Group == "Male") %>% # filter to male patients 129 | e_charts(Date) %>%# over time 130 | e_line(value) %>% # first line layer for values 131 | e_line(mean, symbol = "none") %>% # second line layer for mean (without symbols) 132 | e_line(upper_ci, symbol = "none") %>% # third line for upper CI 133 | e_line(lower_ci, symbol = "none") %>% # fourth line for lower CI 134 | e_tooltip(trigger = "axis") %>% 135 | e_theme_custom("custom.json") 136 | 137 | # EXTRA: Connecting two graphs --------------------------------------------------- 138 | 139 | # make the plot for male patients: 140 | male <- mh %>% 141 | filter(Group == "Male") %>% 142 | e_charts(Date) %>% 143 | e_line(value) %>% 144 | e_tooltip(trigger = "axis") %>% 145 | e_title("Male") %>% 146 | e_line(mean, symbol = "none") %>% 147 | e_group("mh") %>% # to connect them, they need the same group ID 148 | e_y_axis(max = max(mh$value)) # adjusting the y axis so that it's fixed for both 149 | 150 | # make the plot female patients: 151 | female <- mh %>% 152 | filter(Group == "Female") %>% # 153 | e_charts(Date) %>% 154 | e_line(value) %>% 155 | e_tooltip(trigger = "axis") %>% 156 | e_title("Female") %>% 157 | e_line(mean, symbol = "none") %>% 158 | e_group("mh") %>% # same group ID 159 | e_y_axis(max = max(mh$value)) %>% 160 | e_connect_group("mh") # connect this plot with any plots with the same group ID 161 | 162 | # use e_arrange to plot them together 163 | e_arrange(male, female, cols = 2) 164 | 165 | -------------------------------------------------------------------------------- /echarts/coding_sheet_echarts.R: -------------------------------------------------------------------------------- 1 | 2 | # CODING SHEET 3 | # Feel free to follow along the session and fill in this script with code shown by the trainer. 4 | # If at any point you feel lost, you can find the answer code in the "answer_sheet.R" script. 5 | 6 | # Set up ------------------------------------------------------------------ 7 | 8 | library(tidyverse) 9 | library(plotly) 10 | library(echarts4r) 11 | library(rmarkdown) 12 | 13 | cases <- read_csv("covid_data.csv") 14 | 15 | # load in fake indicator data 16 | mh <- read_csv("mhtreatment_data.csv") 17 | 18 | # Single line plot ------------------------------------------------------- 19 | 20 | cases %>% 21 | filter(areaName == "England") %>% 22 | e_charts() 23 | 24 | # Grouped bar plot ------------------------------------------------------- 25 | 26 | 27 | 28 | # Adding layers ----------------------------------------------------------- 29 | 30 | 31 | 32 | # Title, tooltip, legend -------------------------------------------------- 33 | 34 | #Task: Make an easy-to-read plot showing the number of Male patients in treatment for mental health 35 | #over time. As a comparison, plot the mean number in treatment last year as an additional line. 36 | 37 | 38 | 39 | # Using additional arguments from JS ------------------------------------- 40 | 41 | 42 | 43 | # Exercise 2 -------------------------------------------------------------- 44 | 45 | # Using the mh dataset, make an SPC chart (line plot) showing count of male 46 | # mental health patients in treatment over time. Add an additional line for the 47 | # mean. Add two additional lines for the upper and lower confidence intervals. 48 | # Set the tooltip as “axis”. 49 | 50 | 51 | 52 | # EXTRA: Custom themes ---------------------------------------------------- 53 | 54 | 55 | 56 | # EXTRA: Connecting two graphs --------------------------------------------------- 57 | 58 | # make the plot for male patients: 59 | 60 | 61 | 62 | # make the plot female patients: 63 | 64 | 65 | 66 | # use e_arrange to plot them together 67 | 68 | 69 | -------------------------------------------------------------------------------- /exercise_3.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "
![](www/nhsr_logo.png){width=250px}
" 3 | pagetitle: "Title" 4 | author: "Author" 5 | date: '`r Sys.Date()`' 6 | logo: "nhsr_logo.png" 7 | output: html_document 8 | --- 9 | 10 | ```{r setup, include=FALSE} 11 | knitr::opts_chunk$set(echo = FALSE, warning = FALSE) 12 | 13 | library(tidyverse) 14 | library(plotly) 15 | library(echarts4r) 16 | library(rmarkdown) 17 | 18 | mh <- read_csv("mhtreatment_data.csv") 19 | ``` 20 | 21 | ## Patients in treatment 22 | 23 | An example SPC chart using fake data. 24 | 25 | ```{r spc all} 26 | mh %>% 27 | filter(Group == "Male") %>% # filter to male patients 28 | e_charts(Date) %>%# over time 29 | e_line(value) %>% # first line layer for values 30 | e_line(mean, symbol = "none") %>% # second line layer for mean (without symbols) 31 | e_line(upper_ci, symbol = "none") %>% # third line for upper CI 32 | e_line(lower_ci, symbol = "none") %>% # fourth line for lower CI 33 | e_tooltip(trigger = "axis") %>% 34 | e_theme_custom("custom.json") 35 | ``` 36 | 37 | ## Comparison by sex 38 | 39 | ```{r spc sex} 40 | 41 | ``` 42 | -------------------------------------------------------------------------------- /int_plotting_training.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | -------------------------------------------------------------------------------- /mhtreatment_data.csv: -------------------------------------------------------------------------------- 1 | Indicator,Date,value,Group,mean,sd,upper_ci,lower_ci,cons_trend6,value_breach 2 | In_Treatment,2019-07-22,494,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 3 | In_Treatment,2019-07-29,606,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 4 | In_Treatment,2019-08-05,503,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 5 | In_Treatment,2019-08-12,468,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 6 | In_Treatment,2019-08-19,409,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 7 | In_Treatment,2019-08-26,217,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,217 8 | In_Treatment,2019-09-02,443,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 9 | In_Treatment,2019-09-09,362,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 10 | In_Treatment,2019-09-16,359,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 11 | In_Treatment,2019-09-23,425,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 12 | In_Treatment,2019-09-30,443,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 13 | In_Treatment,2019-10-07,406,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 14 | In_Treatment,2019-10-14,646,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,646 15 | In_Treatment,2019-10-21,402,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 16 | In_Treatment,2019-10-28,371,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 17 | In_Treatment,2019-11-04,428,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 18 | In_Treatment,2019-11-11,593,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 19 | In_Treatment,2019-11-18,361,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 20 | In_Treatment,2019-11-25,589,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 21 | In_Treatment,2019-12-02,280,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 22 | In_Treatment,2019-12-09,492,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 23 | In_Treatment,2019-12-16,558,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 24 | In_Treatment,2019-12-23,325,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 25 | In_Treatment,2019-12-30,455,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 26 | In_Treatment,2020-01-06,405,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 27 | In_Treatment,2020-01-13,525,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 28 | In_Treatment,2020-01-20,429,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 29 | In_Treatment,2020-01-27,416,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 30 | In_Treatment,2020-02-03,292,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 31 | In_Treatment,2020-02-10,397,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 32 | In_Treatment,2020-02-17,387,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 33 | In_Treatment,2020-02-24,452,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 34 | In_Treatment,2020-03-02,291,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 35 | In_Treatment,2020-03-09,463,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 36 | In_Treatment,2020-03-16,391,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 37 | In_Treatment,2020-03-23,439,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 38 | In_Treatment,2020-03-30,265,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 39 | In_Treatment,2020-04-06,452,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 40 | In_Treatment,2020-04-13,437,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 41 | In_Treatment,2020-04-20,518,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 42 | In_Treatment,2020-04-27,401,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 43 | In_Treatment,2020-05-04,369,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 44 | In_Treatment,2020-05-11,438,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 45 | In_Treatment,2020-05-18,322,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 46 | In_Treatment,2020-05-25,316,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 47 | In_Treatment,2020-06-01,385,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 48 | In_Treatment,2020-06-08,179,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,179 49 | In_Treatment,2020-06-15,526,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 50 | In_Treatment,2020-06-22,526,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 51 | In_Treatment,2020-06-29,600,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 52 | In_Treatment,2020-07-06,427,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 53 | In_Treatment,2020-07-13,233,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 54 | In_Treatment,2020-07-20,198,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,198 55 | In_Treatment,2020-07-27,544,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 56 | In_Treatment,2020-08-03,357,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 57 | In_Treatment,2020-08-10,456,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 58 | In_Treatment,2020-08-17,371,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 59 | In_Treatment,2020-08-24,565,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 60 | In_Treatment,2020-08-31,359,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 61 | In_Treatment,2020-09-07,380,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 62 | In_Treatment,2020-09-14,471,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 63 | In_Treatment,2020-09-21,359,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 64 | In_Treatment,2020-09-28,311,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 65 | In_Treatment,2020-10-05,352,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 66 | In_Treatment,2020-10-12,488,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 67 | In_Treatment,2020-10-19,584,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 68 | In_Treatment,2020-10-26,463,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 69 | In_Treatment,2020-11-02,196,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,196 70 | In_Treatment,2020-11-09,367,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 71 | In_Treatment,2020-11-16,500,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 72 | In_Treatment,2020-11-23,374,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 73 | In_Treatment,2020-11-30,403,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 74 | In_Treatment,2020-12-07,436,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 75 | In_Treatment,2020-12-14,532,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 76 | In_Treatment,2020-12-21,431,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 77 | In_Treatment,2020-12-28,595,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 78 | In_Treatment,2021-01-04,385,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 79 | In_Treatment,2021-01-11,410,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 80 | In_Treatment,2021-01-18,500,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 81 | In_Treatment,2021-01-25,338,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 82 | In_Treatment,2021-02-01,406,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 83 | In_Treatment,2021-02-08,329,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 84 | In_Treatment,2021-02-15,414,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 85 | In_Treatment,2021-02-22,318,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 86 | In_Treatment,2021-03-01,590,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 87 | In_Treatment,2021-03-08,520,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 88 | In_Treatment,2021-03-15,569,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 89 | In_Treatment,2021-03-22,350,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 90 | In_Treatment,2021-03-29,393,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 91 | In_Treatment,2021-04-05,488,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 92 | In_Treatment,2021-04-12,475,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 93 | In_Treatment,2021-04-19,545,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 94 | In_Treatment,2021-04-26,483,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 95 | In_Treatment,2021-05-03,639,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 96 | In_Treatment,2021-05-10,570,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 97 | In_Treatment,2021-05-17,454,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 98 | In_Treatment,2021-05-24,379,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 99 | In_Treatment,2021-05-31,431,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 100 | In_Treatment,2021-06-07,500,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 101 | In_Treatment,2021-06-14,712,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,712 102 | In_Treatment,2021-06-21,553,Male,383.2326111381117,103.89047414242776,591.0135594229672,175.45166285325618,NA,NA 103 | In_Treatment,2019-07-22,904,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 104 | In_Treatment,2019-07-29,715,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,715 105 | In_Treatment,2019-08-05,816,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 106 | In_Treatment,2019-08-12,1060,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 107 | In_Treatment,2019-08-19,1263,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 108 | In_Treatment,2019-08-26,1174,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 109 | In_Treatment,2019-09-02,1369,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 110 | In_Treatment,2019-09-09,1473,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 111 | In_Treatment,2019-09-16,1204,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 112 | In_Treatment,2019-09-23,1193,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 113 | In_Treatment,2019-09-30,938,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 114 | In_Treatment,2019-10-07,1411,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 115 | In_Treatment,2019-10-14,1270,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 116 | In_Treatment,2019-10-21,1152,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 117 | In_Treatment,2019-10-28,1287,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 118 | In_Treatment,2019-11-04,1004,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 119 | In_Treatment,2019-11-11,1356,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 120 | In_Treatment,2019-11-18,1249,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 121 | In_Treatment,2019-11-25,1165,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 122 | In_Treatment,2019-12-02,1282,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 123 | In_Treatment,2019-12-09,1020,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 124 | In_Treatment,2019-12-16,1135,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 125 | In_Treatment,2019-12-23,1327,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 126 | In_Treatment,2019-12-30,1083,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 127 | In_Treatment,2020-01-06,931,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 128 | In_Treatment,2020-01-13,1225,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 129 | In_Treatment,2020-01-20,1077,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 130 | In_Treatment,2020-01-27,974,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 131 | In_Treatment,2020-02-03,624,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,624 132 | In_Treatment,2020-02-10,955,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 133 | In_Treatment,2020-02-17,1146,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 134 | In_Treatment,2020-02-24,990,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 135 | In_Treatment,2020-03-02,1017,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 136 | In_Treatment,2020-03-09,1285,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 137 | In_Treatment,2020-03-16,693,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,693 138 | In_Treatment,2020-03-23,985,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 139 | In_Treatment,2020-03-30,1130,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 140 | In_Treatment,2020-04-06,1238,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 141 | In_Treatment,2020-04-13,1026,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 142 | In_Treatment,2020-04-20,1569,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,1569 143 | In_Treatment,2020-04-27,1125,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 144 | In_Treatment,2020-05-04,703,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,703 145 | In_Treatment,2020-05-11,996,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 146 | In_Treatment,2020-05-18,1187,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 147 | In_Treatment,2020-05-25,1278,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 148 | In_Treatment,2020-06-01,1111,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 149 | In_Treatment,2020-06-08,756,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 150 | In_Treatment,2020-06-15,876,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 151 | In_Treatment,2020-06-22,1035,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 152 | In_Treatment,2020-06-29,1251,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 153 | In_Treatment,2020-07-06,902,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 154 | In_Treatment,2020-07-13,966,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 155 | In_Treatment,2020-07-20,1219,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 156 | In_Treatment,2020-07-27,1127,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 157 | In_Treatment,2020-08-03,1030,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 158 | In_Treatment,2020-08-10,975,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 159 | In_Treatment,2020-08-17,1464,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 160 | In_Treatment,2020-08-24,1079,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 161 | In_Treatment,2020-08-31,834,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 162 | In_Treatment,2020-09-07,941,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 163 | In_Treatment,2020-09-14,1334,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 164 | In_Treatment,2020-09-21,1011,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 165 | In_Treatment,2020-09-28,1190,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 166 | In_Treatment,2020-10-05,1294,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 167 | In_Treatment,2020-10-12,761,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 168 | In_Treatment,2020-10-19,1330,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 169 | In_Treatment,2020-10-26,1077,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 170 | In_Treatment,2020-11-02,1246,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 171 | In_Treatment,2020-11-09,955,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 172 | In_Treatment,2020-11-16,1056,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 173 | In_Treatment,2020-11-23,1161,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 174 | In_Treatment,2020-11-30,1105,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 175 | In_Treatment,2020-12-07,1198,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 176 | In_Treatment,2020-12-14,1028,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 177 | In_Treatment,2020-12-21,1164,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 178 | In_Treatment,2020-12-28,1197,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 179 | In_Treatment,2021-01-04,1210,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 180 | In_Treatment,2021-01-11,1051,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 181 | In_Treatment,2021-01-18,1301,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 182 | In_Treatment,2021-01-25,1205,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 183 | In_Treatment,2021-02-01,1278,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 184 | In_Treatment,2021-02-08,1520,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,1520 185 | In_Treatment,2021-02-15,1203,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 186 | In_Treatment,2021-02-22,1345,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 187 | In_Treatment,2021-03-01,1146,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 188 | In_Treatment,2021-03-08,1378,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 189 | In_Treatment,2021-03-15,1075,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 190 | In_Treatment,2021-03-22,926,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 191 | In_Treatment,2021-03-29,1280,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 192 | In_Treatment,2021-04-05,933,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 193 | In_Treatment,2021-04-12,1408,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 194 | In_Treatment,2021-04-19,1128,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 195 | In_Treatment,2021-04-26,1031,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 196 | In_Treatment,2021-05-03,1397,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 197 | In_Treatment,2021-05-10,1359,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 198 | In_Treatment,2021-05-17,1507,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 199 | In_Treatment,2021-05-24,1061,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 200 | In_Treatment,2021-05-31,871,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 201 | In_Treatment,2021-06-07,1100,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 202 | In_Treatment,2021-06-14,1312,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 203 | In_Treatment,2021-06-21,1153,Female,1077.2580997758353,193.5796357901617,1464.4173713561586,690.0988281955119,NA,NA 204 | -------------------------------------------------------------------------------- /plotly/answer_sheet_plotly.R: -------------------------------------------------------------------------------- 1 | 2 | # ANSWER SHEET 3 | 4 | # Set up ------------------------------------------------------------------ 5 | 6 | library(tidyverse) 7 | library(plotly) 8 | 9 | # load in COVID-19 case data (available publicly here: https://coronavirus.data.gov.uk/details/download) 10 | cases <- read_csv("covid_data.csv") 11 | 12 | # ggplotly example -------------------------------------------------------- 13 | 14 | plot <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 15 | geom_point() 16 | 17 | ggplotly(plot) 18 | 19 | # Single line plot -------------------------------------------------------- 20 | 21 | cases %>% 22 | filter(areaName == "England") %>% 23 | arrange(date) %>% 24 | plot_ly(x = ~date, y = ~caseRate, 25 | type = 'scatter', mode = "lines") 26 | 27 | # Grouped line plot ------------------------------------------------------ 28 | 29 | cases %>% 30 | arrange(date) %>% 31 | plot_ly(x = ~date, y = ~caseRate, color = ~areaName, 32 | type = 'scatter', mode = "lines") 33 | 34 | 35 | # Single bar plot --------------------------------------------------------- 36 | 37 | cases %>% 38 | filter(areaName == "England") %>% 39 | arrange(date) %>% 40 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar') 41 | 42 | 43 | # Adding line layer to bar plot ------------------------------------------- 44 | 45 | cases %>% 46 | filter(areaName == "England") %>% 47 | arrange(date) %>% 48 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', name = "Daily cases") %>% 49 | add_trace(y = ~rollingAvg, name = "Rolling avg", type = 'scatter', mode = 'lines') 50 | 51 | #NOTE: alternatively, use add_lines to be more specific about the layer you are adding. 52 | #You also won't need to specify type and mode if you use add_lines 53 | 54 | cases %>% 55 | filter(areaName == "England") %>% 56 | arrange(date) %>% 57 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', name = "Daily cases") %>% 58 | add_lines(y = ~rollingAvg, name = "Rolling avg") 59 | 60 | # Adding title and tooltip ------------------------------------------------ 61 | 62 | cases %>% 63 | filter(areaName == "England") %>% 64 | arrange(date) %>% 65 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', name = "Daily cases") %>% 66 | add_lines(y = ~rollingAvg, name = "Rolling avg") %>% 67 | layout(title = "Positive cases over time", hovermode = "x unified") 68 | 69 | # Modifying legends ------------------------------------------------------- 70 | 71 | cases %>% 72 | filter(areaName == "England") %>% 73 | arrange(date) %>% 74 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', name = "Daily cases") %>% 75 | add_lines(y = ~rollingAvg, name = "Rolling avg") %>% 76 | layout(title = "Positive cases over time", 77 | hovermode = "x unified", 78 | legend = list(orientation = "h", 79 | xanchor = "center", 80 | x = 0.5), 81 | xaxis = list(title = "")) 82 | 83 | 84 | # Modifying hover text ---------------------------------------------------- 85 | 86 | cases %>% 87 | filter(areaName == "England") %>% 88 | arrange(date) %>% 89 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', 90 | name = "Daily cases", 91 | hovertemplate = "%{y} positive on %{x}") %>% 92 | add_lines(y = ~rollingAvg, name = "Rolling avg") %>% 93 | layout(title = "Positive cases over time", 94 | hovermode = "x unified", 95 | legend = list(orientation = "h", 96 | xanchor = "center", 97 | x = 0.5), 98 | xaxis = list(title = "")) 99 | 100 | # Changing marker colour --------------------------------------------------- 101 | 102 | cases %>% 103 | filter(areaName == "England") %>% 104 | arrange(date) %>% 105 | plot_ly(x = ~date) %>% 106 | add_bars(y = ~newCasesByPublishDate, name = "Daily cases", 107 | marker = list(color = "#5694ca")) %>% 108 | add_lines(y = ~rollingAvg, name = "Rolling avg", line = list(color = "#003078")) %>% 109 | layout(title = "Positive cases over time", 110 | hovermode = "x unified", 111 | legend = list(orientation = "h", 112 | xanchor = "center", 113 | x = 0.5), 114 | xaxis = list(title = "")) 115 | 116 | 117 | # Editing the modebar ----------------------------------------------------- 118 | 119 | cases %>% 120 | filter(areaName == "England") %>% 121 | arrange(date) %>% 122 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = 'bar', 123 | name = "Daily cases", 124 | marker = list(color = "#72ceff")) %>% 125 | config(modeBarButtonsToRemove = c("zoomIn2d", "zoomOut2d", "select2d", "lasso2d")) 126 | 127 | # refer here for a full list of modebar buttons: https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js 128 | 129 | # Exercise 1 -------------------------------------------------------------- 130 | 131 | cases %>% 132 | filter(areaName == "England") %>% 133 | arrange(date) %>% 134 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = "bar", 135 | name = "Cases") %>% # make base bar plot named “Cases” 136 | add_lines(y = ~rollingAvg, type = "scatter", mode = "lines", # add line layer for rolling average 137 | name = "7-day av", line = list(color = '#003078')) %>% # name it "7-day av" and change its colour 138 | layout(title = "Cases by specimen date", # add title 139 | hovermode = "x unified", # modify tooltip 140 | legend = list(orientation = "h", # move legend to the bottom 141 | xanchor = "center", 142 | x = 0.2), 143 | xaxis = list(title = ""), # remove x axis title 144 | yaxis = list(title = "")) # remove y axis title 145 | 146 | # EXTRA: buttons --------------------------------------------------------- 147 | 148 | # make buttons using lists. For this example we are using method = "restyle" 149 | button_list <- list( 150 | list( 151 | method = "restyle", 152 | args = list("type", "bar"), # first button with label "Bar" that changes type to "bar" 153 | label = "Bar" 154 | ), 155 | list( 156 | method = "restyle", 157 | args = list("type", "scatter"), # second button with label "Scatter" that changes type to "scatter" 158 | label = "Scatter" 159 | )) 160 | 161 | cases %>% 162 | filter(areaName == "England") %>% 163 | arrange(date) %>% 164 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = "bar", 165 | name = "Cases") %>% 166 | layout(updatemenus = list( # to add these buttons, use updatemenus arg 167 | list( 168 | type = "buttons", 169 | y = 0.8, #placement of buttons on y axis 170 | buttons = button_list # add in list that we created previously 171 | ) 172 | )) 173 | 174 | # EXTRA: dropdowns -------------------------------------------------------- 175 | 176 | # make buttons using lists. 177 | button_list <- list( 178 | list( 179 | method = "restyle", 180 | args = list("transforms[0].value", "England"), # first button that transforms value to England 181 | label = "England" 182 | ), 183 | list( 184 | method = "restyle", 185 | args = list("transforms[0].value", "Hertfordshire"), # first button that transforms value to Hertfordshire 186 | label = "Herts" 187 | )) 188 | 189 | cases %>% 190 | arrange(date) %>% 191 | plot_ly(x = ~date, y = ~newCasesByPublishDate, type = "bar", 192 | name = "Cases", 193 | transforms = list( # in order to access the "transforms[0].value" attribute, we must make one. 194 | list( 195 | type = "filter", # we want it to transform by filtering... 196 | target = ~areaName, # the areaName variable.. 197 | operator = '=', # by equaling.. 198 | value = ~c("England", "Hertfordshire")))) %>% # either England or Hertfordshire. 199 | layout(updatemenus = list( 200 | list(type = 'dropdown', # the updatemenus is a dropdown this time 201 | active = 0, # first option of England by default (javascript starts from 0 not 1) 202 | buttons = button_list))) # using the button list we made before 203 | -------------------------------------------------------------------------------- /plotly/coding_sheet_plotly.R: -------------------------------------------------------------------------------- 1 | 2 | # CODING SHEET 3 | # Feel free to follow along the session and fill in this script with code shown by the trainer. 4 | # If at any point you feel lost, you can find the answer code in the "answer_sheet.R" script. 5 | 6 | # Set up ------------------------------------------------------------------ 7 | 8 | library(tidyverse) 9 | library(plotly) 10 | library(echarts4r) 11 | library(rmarkdown) 12 | 13 | # load in COVID-19 case data (available publicly here: https://coronavirus.data.gov.uk/details/download) 14 | cases <- read_csv("covid_data.csv") 15 | 16 | # ggplotly example -------------------------------------------------------- 17 | 18 | plot <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) + 19 | geom_point() 20 | 21 | ggplotly(plot) 22 | 23 | # Single line plot -------------------------------------------------------- 24 | 25 | cases %>% 26 | filter(areaName == "England") %>% 27 | arrange(date) %>% 28 | plot_ly() 29 | 30 | # Grouped line plot ------------------------------------------------------ 31 | 32 | 33 | 34 | # Single bar plot --------------------------------------------------------- 35 | 36 | 37 | 38 | # Adding line layer to bar plot ------------------------------------------- 39 | 40 | 41 | 42 | # Adding title and tooltip ------------------------------------------------ 43 | 44 | 45 | 46 | # Modifying legends ------------------------------------------------------- 47 | 48 | 49 | 50 | # Modifying hover text ---------------------------------------------------- 51 | 52 | 53 | 54 | # Changing marker colour --------------------------------------------------- 55 | 56 | 57 | 58 | # Editing the modebar ----------------------------------------------------- 59 | 60 | 61 | 62 | # refer here for a full list of modebar buttons: https://github.com/plotly/plotly.js/blob/master/src/components/modebar/buttons.js 63 | 64 | # Exercise 1 -------------------------------------------------------------- 65 | 66 | 67 | 68 | # EXTRA: buttons --------------------------------------------------------- 69 | 70 | 71 | # EXTRA: dropdowns -------------------------------------------------------- 72 | 73 | -------------------------------------------------------------------------------- /www/nhsr_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AYu1804/int_plotting_training/46b99c1eef3dc2efef727aab143bffd75cf5c9a8/www/nhsr_logo.png --------------------------------------------------------------------------------