Title: | Visualisation of Sub-National Covid Data for Africa |
---|---|
Description: | Visualisation of Sub-National Covid Data for Africa. |
Authors: | Andy South [aut, cre] |
Maintainer: | Andy South <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.0.9000 |
Built: | 2024-11-11 03:29:53 UTC |
Source: | https://github.com/afrimapr/africovid |
*in progress
afcov(country, language = "en", dates = "all", timeinterval = NULL)
afcov(country, language = "en", dates = "all", timeinterval = NULL)
country |
a character vector of country names or iso3c character codes. |
language |
'which admin level to return 'en' or 'fr' for country name |
dates |
either 'all', 'last' or c(start,end) in format "2021-01-31" |
timeinterval |
optional interval to sum over, options e.g. "5 days" "week" "month" |
dataframe
*in progress to show cases or deaths Initial ggplot code copied from https://github.com/VictimOfMaths/COVID-19/blob/master/Heatmaps/English%20LA%20Heatmaps.R
afcov_heatmap( country, attribute = "CONTAMINES", areanames = "namesgeob", dates = "all", language = "en", legend.position = "top", palette = "YlGnBu", timeinterval = NULL, date_legend = c("2020-04", "2020-05", "2020-06", "2020-07", "2020-08", "2020-09", "2020-10", "2020-11", "2020-12", "2021-01", "2021-02", "2021-03", "2021-04", "2021-05") )
afcov_heatmap( country, attribute = "CONTAMINES", areanames = "namesgeob", dates = "all", language = "en", legend.position = "top", palette = "YlGnBu", timeinterval = NULL, date_legend = c("2020-04", "2020-05", "2020-06", "2020-07", "2020-08", "2020-09", "2020-10", "2020-11", "2020-12", "2021-01", "2021-02", "2021-03", "2021-04", "2021-05") )
country |
a character vector of country names or iso3c character codes. |
attribute |
attribute to plot, from dfhera |
areanames |
name of column containing the area names ('namesgeob' added to match geoboundaries, 'REGION' is in raw data ) |
dates |
either 'all', 'last' or c(start,end) in format "2021-01-31" |
language |
'which admin level to return'en' or 'fr' for country name |
legend.position |
default "top", options "left","right","bottom" |
palette |
RColorBrewer palette options default="YlGnBu" |
timeinterval |
optional interval to sum over, options e.g. "5 days" "week" "month" |
date_legend |
axis breaks to appear in plots |
ggplot
afcov_heatmap('Mali') afcov_heatmap('senegal', dates=c("2021-01-01","2021-04-01"))
afcov_heatmap('Mali') afcov_heatmap('senegal', dates=c("2021-01-01","2021-04-01"))
*in progress to show cases or deaths
afcov_map( country, attribute = "CONTAMINES", dates = "last", timeinterval = NULL, language = "en", legend.position = "top", palette = "YlGnBu" )
afcov_map( country, attribute = "CONTAMINES", dates = "last", timeinterval = NULL, language = "en", legend.position = "top", palette = "YlGnBu" )
country |
a character vector of country names or iso3c character codes. |
attribute |
attribute to plot, from dfhera |
dates |
either 'all', 'last' or c(start,end) in format "2021-01-31" |
timeinterval |
optional interval to sum over, options e.g. "5 days" "week" "month" |
language |
'which admin level to return 'en' or 'fr' for country name |
legend.position |
default "top", options "left","right","bottom" |
palette |
RColorBrewer palette options default="YlGnBu" |
ggplot
afcov_map('Mali') #a 6 daily facetted map afcov_map('senegal', dates=c("2021-01-01","2021-01-06"))
afcov_map('Mali') #a 6 daily facetted map afcov_map('senegal', dates=c("2021-01-01","2021-01-06"))
conversion from country names to iso3c code
country2iso(country)
country2iso(country)
country |
a character vector of country names |
character vector of iso3c codes
iso3c <- country2iso("nigeria")
iso3c <- country2iso("nigeria")
subnational covid data from HERA
dfhera
dfhera
dataframe
An object of class tbl_df
(inherits from tbl
, data.frame
) with 64292 rows and 17 columns.
data
subnational daily covid statistics
https://data.humdata.org/organization/hera-humanitarian-emergency-response-africa
*in progress
join_all_subnat_to_map(dfhera)
join_all_subnat_to_map(dfhera)
dfhera |
can pass in progress dataframe containing the hera data |
dataframe
in progress
join_subnat_to_map(country = "senegal")
join_subnat_to_map(country = "senegal")
country |
a character vector of country names or iso3c character codes. |
dataframe
to run the shiny web application.
runviewer()
runviewer()
BEWARE code in africovid-creation.r is more up-to-date than this *in progress
update_data()
update_data()
will try to download data from HDX and use this to update locally the data stored in the package
dataframe