Shiny applications not supported in static R Markdown documents

Worldwide Deaths Map Confirmed Cases Graph 1) Talk about the sudden increase which is related to the changes made in the way the tests were being taken. 2) Talk about the decrease in cases and deaths and relate that with the actions that china took on a certain date. 3) Talk about the sudden increase related to the increase in cases outside of China with countries having less strict isolation/testing protocols 4) Talk about any corelation the number of deaths outside china with google trends. ## Shiny App Discussion

The project included a scatter plot with one of the y-axis variables as confirmed cases of COVID-19 virus around the world. The graph above(presented in the screenshot) shows us a relatively linear increase in the number of the case since from day 22 onwards, however, it can be seen that there is a sudden increase in the number of cases around day 43. This sudden jump in numbers can be tracked down to refinement of diagnostic criteria by Chinese scientists on 12th February earlier this year. This sudden uptick was reported in several news media channels including The New York Times*. Since most early cases of COVID-19 virus were present in the Chinese Province of Hubei we can also see that after policy changes were made to lock down the province there was a decrease in the growth rates that can be visible in the days following 13th February (Day 44).

The decrease in the curve’s gradient, however, does not last long as we can see a positive quadratic rate of change in the number of confirmed cases. The increase in the curves’ gradient can be related to a sharp increase in the number of cases in Iran and European countries such as Italy, Germany, and France. We can infer from the results of the Chinese government’s policy change regarding the lockdown that it can play a significant role in decreasing new cases of the COVID-19 virus thus reducing the chances of an exponential increase in the spread of coronavirus.

In figure three I use google search trends to analyze the popularity of coronavirus searches versus google searches for the world’s biggest social media platform, “Facebook”. We can see from the graph that before late February Coronavirus searches were half as popular as those for Facebook but following a sudden increase in the growth rates for the virus and the spread of the virus to countries worldwide, there was a sharp increase in searches related to coronavirus. In the course of a month, google searches for coronavirus exceed those for Facebook by almost four to one. This increase in searches is a sign of mass concern/fear around the world.

Figure 1. shows an interactive world map with translucent circles showing the number of Coronavirus cases in each country. We can see from the graph that the cases of COVID-19 contraction in the European Union are spread from country to country. One of the many reasons for this form of spreading of the virus can be related to the ease of travel due to treaties in the E.U. If we are to use the slider from day 55 onwards, the trend can be seen as the virus takes a strong-hold in southern Europe traveling to neighboring countries.

Technical Report

To build this shiny app I used extensive data-wrangling and manipulation to restructure my data to be used efficiently in the app. The initial datasets were using every date as a column, and each kind of case (confirmed, recovered, death) as it’s CSV format file. To structure this data according to the needs of the project, I use the ‘select’ command to create subsets of the datasets. Since my several countries were also reported with provinces/states I collected and summed up results for these countries using the ‘group_by’ and ‘summarize’ commands. Since the dates for all subsets were noted in a non-conventional method, I created substrings from the dates and then changed the dates into days since the first reported day for the data which made it easier to create the slider later in the project. Once all datasets were in the right formats I used the ‘left_join’ command by creating unique IDs for each column; to then combine my datasets into a singular uniform dataset which I used to create an interactive world map.

To create an interactive world map within my shiny app, I used several of the techniques we learned throughout class followed by personal research. I used the leaflet API/library to create the world. To plot the initial points of reported COVID-19 cases I used the renderLeaflet method which creates an instance of the leaflet class. Within this map, I used the ‘and circles’ function to then plot the cases by country using the longitude/latitude information from my dataset. To showcases by severity, I set the colors and sizes of the points on the table to change by the number of cases in a country. I then use the ‘Observe’ method to track any clicks on the checkbox to show the heatmap for several deaths in a country which are also represented by circles overlaying on the map with aesthetic differences according to the severity. I used the knowledge of sliders and scatterplots learned during the period of the class to make the map/plot responsive to the users’ input.

Finally, I used the knowledge of web scraping and additional research to scrape google search trends data through the Google trends API which was returned in the form of a JSON object. I then converted the JSON object into a CSV format followed by filtering down the dataset to rows that matched the criteria. One of the harder challenges I faced during this project was to use Twitter’s official developer API to scrape tweets about COVID-19 to study the trends in social media posts about the pandemic. However, I was unable to use the data provided through Twitter due to the technical limitation which limited mining to only 18000 tweets at a time which was not helpful in this case since on average there were almost 18000 tweets about the virus every thirty minutes. The code for twitter data mining API is attached in a separate file in the project directory.

In summary, I used the graph visualization, shiny apps, data wrangling, and data ethics skills that I learned during this course to create this shiny app successfully.