Plot maps for nCoV in China

plot_map(
  x,
  key = c("confirmedCount", "suspectedCount", "curedCount", "deadCount"),
  filter = "unkown",
  legend_title = "Confirmed",
  color = "Reds",
  scale = c("cat", "log"),
  method = c("province", "city", "country")
)

Arguments

key

the column name

filter

the rows to remove.

legend_title

legend title

color

The colors or color function that values will be mapped to, see RColorBrewer::display.brewer.all()

scale

"cat" for category, 'log' for numeric

method

'province' or 'city'.

ncov

the dataset obtained by get_ncov()

Value

Examples

ncov <- get_ncov()
#> 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
#> No encoding supplied: defaulting to UTF-8.
#> Parsed with column specification: #> cols( #> City = col_character(), #> City_Admaster = col_character(), #> City_EN = col_character(), #> Province = col_character(), #> Province_EN = col_character(), #> Region = col_character(), #> Tier = col_character() #> )
#> No encoding supplied: defaulting to UTF-8.
#> Error: lexical error: invalid char in json text. #> <html> <head><title>503 Servic #> (right here) ------^
plot_map(ncov)
#> Error: 'leafletcn.map.names' is not an exported object from 'namespace:leafletCN'