## DATA SCIENCE IN A PANDEMIC
## Professor Dennis F.X. Mathaisel
## This script entails a data structure visualization, ## referenced as Figure 1 in the paper.
# Script developed by Abdullah Zahid under direction of Professor Mathaisel
# Continental Cases and Deaths of COVID-19
library(ggplot2) library(dplyr) library(hrbrthemes) library(viridis) library(Hmisc) library(tidyr) library(ggvis)
# Set the working directory
setwd(“C:/Docs/Papers/COVID-19/Journal Papers/1st Paper Data Science in a Pandemic/Data Science Journal/Revision Data Science Journal/Scripts/1st Paper Scripts Repository/Data”)
covid= read.csv(“Asia Top 5 Cases.csv”) #Checking structure of Data
str(covid)
#Checking Missing NA of Data anyNA(covid$date) anyNA(covid$day) anyNA(covid$month) anyNA(covid$cases) anyNA(covid$deaths) anyNA(covid$countries) anyNA(covid$geoId) anyNA(covid$countrycode) anyNA(covid$popData2018) anyNA(covid$continent)
library(plotly) df <- covid
fig <- df %>% plot_ly(
x = ~countries, y = ~cases,
split = ~countries, type = ‘violin’, box = list(
visible = T
),
meanline = list(
visible = T
)
)
fig
fig <- fig %>% layout(
xaxis = list(
title = “Asia COVID Cases”
),
yaxis = list(
title = “Number of Cases”, zeroline = F
)
)
fig
# END OF SCRIPT
© 2024 Babson College. All rights reserved.