Package 'africovid'

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

Help Index


to return subnational covid data by country and optionally date

Description

*in progress

Usage

afcov(country, language = "en", dates = "all", timeinterval = NULL)

Arguments

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"

Value

dataframe


plot heatmap of subnational covid data

Description

*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

Usage

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")
)

Arguments

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

Value

ggplot

Examples

afcov_heatmap('Mali')

afcov_heatmap('senegal', dates=c("2021-01-01","2021-04-01"))

plot map of subnational covid data by country

Description

*in progress to show cases or deaths

Usage

afcov_map(
  country,
  attribute = "CONTAMINES",
  dates = "last",
  timeinterval = NULL,
  language = "en",
  legend.position = "top",
  palette = "YlGnBu"
)

Arguments

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"

Value

ggplot

Examples

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

Description

conversion from country names to iso3c code

Usage

country2iso(country)

Arguments

country

a character vector of country names

Value

character vector of iso3c codes

Examples

iso3c <- country2iso("nigeria")

subnational covid data from HERA

Description

subnational covid data from HERA

Usage

dfhera

Format

dataframe

An object of class tbl_df (inherits from tbl, data.frame) with 64292 rows and 17 columns.

Slots

data

subnational daily covid statistics

Source

https://data.humdata.org/organization/hera-humanitarian-emergency-response-africa


join geoboundaries admin names onto the hera data to allow joining to a map later

Description

*in progress

Usage

join_all_subnat_to_map(dfhera)

Arguments

dfhera

can pass in progress dataframe containing the hera data

Value

dataframe


join subnational data to map of admin boundaries

Description

in progress

Usage

join_subnat_to_map(country = "senegal")

Arguments

country

a character vector of country names or iso3c character codes.

Value

dataframe


to run the shiny web application.

Description

to run the shiny web application.

Usage

runviewer()

update package data from HERA via HDX

Description

BEWARE code in africovid-creation.r is more up-to-date than this *in progress

Usage

update_data()

Details

will try to download data from HDX and use this to update locally the data stored in the package

Value

dataframe