Plot time series of a country's cases
plot_ts( x, area, area_col = "countryEnglishName", date_col = "date", ts_col = c("confirmedCount", "curedCount", "deadCount") )
x | a datafram with "countryEnglishName", "date", "confirmed", "cured", "dead" columns |
---|---|
area | name of an selected area |
area_col | the column name of the area in x |
date_col | the column name of the date in x |
ts_col | the column names of the time series in x |
a figure
#> Warning: InternetOpenUrl failed: 'The server name or address could not be resolved'#> Error in readRDS(gzcon(url("https://github.com/pzhaonet/ncov/raw/master/static/data-download/ncov.RDS"))) : #> cannot open the connection#>#>#> #>#>#> Error: lexical error: invalid char in json text. #> <html> <head><title>503 Servic #> (right here) ------^#> Error in ncovr:::conv_time(ncov_raw$area$updateTime): object 'ncov_raw' not foundx <- ncov_raw$area[, c("countryEnglishName", "countryName", "date", "confirmedCount", "curedCount", "deadCount")] %>% roup_by(countryEnglishName, date) %>% summarise(confirmed = sum(confirmedCount), cured = sum(curedCount), dead = sum(deadCount)) %>% ungroup()#> Error in eval(lhs, parent, parent): object 'ncov_raw' not found#> Error in eval(expr, envir, enclos): object 'x' not foundplot_ts(x, area = "Korea")#> Error in seq.Date(from = min(x[, date_col]), to = max(x[, date_col]), by = 1): object 'x' not found