[R] COVID-19 datasets...

PIKAL Petr petr@p|k@| @end|ng |rom prechez@@cz
Tue May 5 08:46:55 CEST 2020


Another option is

https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographic-distribution-covid-19-cases-worldwide

Together with instruments from

https://www.repidemicsconsortium.org/

Cheers
Petr

Here is some simple code

library(EpiEstim)
library(ggplot2)
library(lubridate)
library(incidence)
library(distcrete)
library(epitrix)
library(readxl)

mena <- c("Austria", "Czechia", "Germany", "Italy", "Japan", "Russia", "South_Korea", 
"Spain", "Sweden", "Taiwan", "United_States_of_America", "United_Kingdom")

plot_Ri <- function(estimate_R_obj) {
    p_I <- plot(estimate_R_obj, "incid") + ggtitle(staty[vyber][i])  # plots the incidence
    p_SI <- plot(estimate_R_obj, "SI")  # plots the serial interval distribution
    p_Ri <- plot(estimate_R_obj, "R") + ylim(c(0,5))
    return(gridExtra::grid.arrange(p_I, p_Ri, ncol = 1))
}

data <- read_excel("covid.xlsx")
data <- as.data.frame(data)
staty <- levels(factor(data[,7]))
vyber <- which(staty %in% mena)
staty[vyber]

# covid.xlsx is downloaded data

vyber <- which(staty %in% mena)
vyber <- vyber[-6]
staty[vyber]
ddd <- vector("list", length=length(vyber))
pdf("grafy2.pdf")
for (i in 1:length(vyber)) {
temp <- data[data[,7]==staty[vyber][i],]
temp$cas <- ymd(temp$dateRep)
ooo <- order(temp$cas)
temp <- temp[ooo,]
temp<- temp[-1,]
temp <- temp[-(1:min(which(temp$cases>0))-1),]
head(temp)
test <- temp[, c(12,5)]
names(test) <- c("date", "I")
test$I <- abs(test$I)
inc <- rep(test$date, test$I)
inci <- incidence(inc)
peak <- find_peak(inci)
fit <- incidence::fit(inci, split=peak)
print(plot(inci, fit = fit)+ggtitle(staty[vyber][i]))
ddd[[i]] <- rbind(fit$before$info$doubling.conf, fit$after$info$halving.conf)
vysled <- estimate_R(test, method = "uncertain_si",
    config = make_config(list(mean_si = 4, std_mean_si = 2,
        min_mean_si = 1, max_mean_si = 8.4, std_si = 2.4, std_std_si = 1,
        min_std_si = 0.5, max_std_si = 4, n1 = 1000, n2 = 1000)))
print(plot_Ri(vysled))
}
dev.off()
names(ddd) <- staty[vyber]
ddd


> -----Original Message-----
> From: R-help <r-help-bounces using r-project.org> On Behalf Of Bernard Comcast
> Sent: Monday, May 4, 2020 8:56 PM
> To: James Spottiswoode <james using jsasoc.com>
> Cc: r-help using r-project.org
> Subject: Re: [R] COVID-19 datasets...
> 
> Thanks, i will take a look
> 
> Bernard
> Sent from my iPhone so please excuse the spelling!"
> 
> > On May 4, 2020, at 2:49 PM, James Spottiswoode <james using jsasoc.com>
> wrote:
> >
> > Sure. COVID-19 Data Repository by the Center for Systems Science and
> Engineering (CSSE) at Johns Hopkins University is available here:
> >
> > https://github.com/CSSEGISandData/COVID-19
> >
> > All in csv fiormat.
> >
> >
> >> On May 4, 2020, at 11:31 AM, Bernard McGarvey
> <mcgarvey.bernard using comcast.net> wrote:
> >>
> >> Just curious does anyone know of a website that has data available in a
> format that R can download and analyze?
> >>
> >> Thanks
> >>
> >>
> >> Bernard McGarvey
> >>
> >>
> >> Director, Fort Myers Beach Lions Foundation, Inc.
> >>
> >>
> >> Retired (Lilly Engineering Fellow).
> >>
> >> ______________________________________________
> >> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >>
> >
> > James Spottiswoode
> > Applied Mathematics & Statistics
> > (310) 270 6220
> > jamesspottiswoode Skype
> > james using jsasoc.com
> >
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


More information about the R-help mailing list