Skip to content

Instantly share code, notes, and snippets.

View balajis's full-sized avatar

Balaji S. Srinivasan balajis

View GitHub Profile
# Quick hack to read latest JHU data and plot confirmed cases and deaths
# Dashboard: https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
# Data: https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series
caseplot <- function(filename, color) {
uu = read.csv(filename, header=TRUE, stringsAsFactors=FALSE)
vv = uu[which(uu[,2] == "US"),]
cumulative.confirmed = apply(vv[,5:60], 2, sum)
new.confirmed = diff(cumulative.confirmed)
plot(new.confirmed, col=color, type='o', xlab="", ylab="", main="", lty="dashed", pch=20)