Giter Club home page Giter Club logo

afrihealthsites's Introduction

afrihealthsites

access to geographic locations of african health facilities from different sources.

See web interface and paper demonstrating these components.

Part of the afrimapr project.

In early development, will change, contact Andy South with questions.

Install afrihealthsites

Install the development version from GitHub :

# install.packages("remotes") # if not already installed

remotes::install_github("afrimapr/afrihealthsites")

First Usage

library(afrihealthsites)
library(sf)

## WHO database 

# with interactive map
sfken <- afrihealthsites("kenya", datasource='who', plot='mapview')

# static map
sfeth <- afrihealthsites("ethiopia", datasource='who', plot='sf')

## healthsites.io

# pre-downloaded data

# with interactive map
sfmali <- afrihealthsites("mali", datasource='healthsites', plot='mapview')

## compare locations from different sources

compare_hs_sources('togo')

# these are defaults
compare_hs_sources('togo', datasources=c('who', 'healthsites'), plot='mapview')

# run a shiny application allowing you to select any country
runviewer()

# live data - requires a free API key from https://healthsites.io/
library(rhealthsites)
#rhealthsites::hs_set_api_key('[requires a free API key from https://healthsites.io/]')

# with interactive map
sfmali <- afrihealthsites("mali", datasource='healthsites_live', plot='mapview')

Find National Master Facility Lists

# all countries list of available MFLs
df <- national_list_avail()

# availability for a single country
national_list_avail("Togo")

# url for data (if available)
national_list_url("Ghana")

# example of reading in data direct from a url and mapping
# will only work for countries where "machine_readable" is TRUE
dfgha <- read.csv(national_list_url("Ghana"))
sfgha <- sf::st_as_sf(dfgha, coords=c("Longitude","Latitude"), crs=4326, na.fail=FALSE)
afrihealthsites('gha',datasource=sfgha, type_column='Type')

specifying countries

The following can be used :

  • capitalisation (as you would write the country name in normal text e.g. "South Africa"
  • all lower caps (e.g. "south africa")
  • 3 letter country iso3c code (e.g. "zaf")
sfzaf1 <- afrihealthsites("south africa", datasource='who', plot=FALSE)
sfzaf2 <- afrihealthsites("ZAF", datasource='healthsites', plot='sf')
sfzaf3 <- afrihealthsites("South Africa", datasource='who', plot='mapview')

Research notice

Please note that this repository is participating in a study into sustainability of open source projects. Data will be gathered about this repository for approximately the next 12 months, starting from June 2021.

Data collected will include number of contributors, number of PRs, time taken to close/merge these PRs, and issues closed.

For more information, please visit the informational page or download the participant information sheet.

afrihealthsites's People

Contributors

andysouth avatar anelda avatar yochannah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

afrihealthsites's Issues

[Existing data]KEMRI/WHO import differs from original spreadsheet

Which dataset
KEMRI/WHO

Short description of the error or suggestion
When I import the original spreadsheet with read_excel it and filter Country for 'South Africa' there are 4303 observations but when I import the same dataset via afrihealthsites I find 4288 observations.

> ah_kemri_who_tb <- afrihealthsites(country="south africa", datasource = "who")
> dim(ah_kemri_who_tb)
[1] 4288    8
> kemri_excel <- read_excel('data/raw_data/who-cds-gmp-2019-01-eng.xlsx') %>% filter(Country == 'South Africa')
                                                                                                                 
> dim(kemri_excel)
[1] 4303    8

Suggested actions

I'm trying to figure out what is going on and will report back here.

[Existing data] KEMRI/WHO coordinates

Which dataset
KEMRI-WHO

Short description of the error or suggestion
The dataset is downloaded as SF object. In the original spreadsheet, there are two columns for coordinates called Lat and Long which isn't present in the object that is downloaded via afrihealthsites.

> ah_kemri_who_tb <- afrihealthsites(country="south africa", datasource = "who")
> colnames(ah_kemri_who_tb)
[1] "Country"       "Admin1"        "Facility name" "Facility type" "Ownership"     "LL source"     "geometry"     
[8] "iso3c"   
> kemri_excel <- read_excel('data/raw_data/who-cds-gmp-2019-01-eng.xlsx') %>% filter(Country == 'South Africa')
> colnames(kemri_excel)
[1] "Country"       "Admin1"        "Facility name" "Facility type" "Ownership"     "Lat"           "Long"         
[8] "LL source" 

Suggested actions
Please is it possible to add the two columns with Lat and Long as per the original Excel file?

[Feature] Use iso3c for country specification

Is your feature request related to a problem? Please describe.
At the moment the query to access country-specific data looks like this:

afrihealthsites("south africa", datasource = "healthsites", plot = FALSE)

The way that we have to specify the country i.e. lower case full name is not very intuitive.

Describe the solution you'd like
Maybe rather specify that one should use the iso3c or another standardised way to extract a country to make it as straight-forward as possible for users?

small [Bug] in UI with admin region selection : object 'mapplot' not found

Happens because map plotting is triggered by country change which also triggers change in admin regions (if option selected).

It's just a temporary error msg that flashes up & is then replaced.

On changing country with region selection enabled, compare_hs_sources() is being called with the admin region selection from the previous country.

Best solution will be to sort out the reactivity chain, but tricky because admin region selection is not always enabled.

https://github.com/afrimapr/afrihealthsites/tree/master/inst/shiny/healthsites_viewer_v03

Serialization warning R version >= 3.5.0

Hi Andy,

I had this warning when I installed the latest version of the package.

  NB: this package now depends on R (>= 3.5.0)
     WARNING: Added dependency on R >= 3.5.0 because serialized objects in  serialize/load version 3 cannot be read in older versions of R.  File(s) containing such objects:afrihealthsites/data/sfssd.rda

I think making the package depends on R (>= 3.5.0) in DESCRIPTION will remove it.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.