Description Usage Arguments Value See Also Examples
View source: R/afrihealthsites.r
locations from WHO and healthsites.io. Part of afrimapr project.
returns healthsite locations for specified countries and optionally plots map
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | afrihealthsites(
country,
datasource = "healthsites",
plot = "mapview",
hs_amenity = "all",
who_type = "all",
type_filter = "all",
returnclass = "sf",
type_column = "Facility Type",
label_column = "Facility Name",
lonlat_columns = c("Longitude", "Latitude"),
admin_level = NULL,
admin_names = NULL
)
|
country |
a character vector of country names or iso3c character codes. |
datasource |
data source, 'healthsites' predownloaded, 'who', 'healthsites_live' needs API, 'hdx' not working yet |
plot |
option to display map 'mapview' for interactive, 'sf' for static |
hs_amenity |
filter healthsites data by amenity. 'all', 'clinic', 'dentist', 'doctors', 'pharmacy', 'hospital' to exclude dentist hs_amenity=c('clinic', 'doctors', 'pharmacy', 'hospital') |
who_type |
filter by Facility type |
type_filter |
filter by facility type (from the type_column, or internally defined for healthsites & who) |
returnclass |
'sf' or 'dataframe', currently 'dataframe' only offered for WHO so that can have points with no coords |
type_column |
for user provided files which column has information on type of site, default : 'Facility Type' |
label_column |
for user provided files which column has information on name of site, default : 'Facility Name' |
lonlat_columns |
for user provided files which columns contain longitude, latitude. option of NULL if no coords |
admin_level |
what admin level to filter regions from FALSE or NULL if no filtering |
admin_names |
names of admin regions to filter NULL if no filter |
sf
afrihealthsites
compare_hs_sources
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | sfnga <- afrihealthsites("nigeria", datasource='who', plot='sf')
afrihealthsites('chad', datasource='who', plot='sf')
afrihealthsites('chad', datasource='healthsites', plot='sf')
sfnga <- afrihealthsites("nigeria", plot='mapview')
#to return raw dataframe for WHO data including any rows with no coordinates
dfzaf <- afrihealthsites("south africa", datasource='who', plot=FALSE, returnclass='dataframe')
#note that ISO 3 letter codes and country names with upper case letters can also be used
#afrihealthsites("ZAF")
#afrihealthsites("South Africa")
#filter healthsites data by amenity type
afrihealthsites('chad',datasource = 'healthsites', hs_amenity=c('clinic','hospital'))
#filter who data by Facility type
afrihealthsites('chad',datasource = 'who',who_type=c('Regional hospital','Health Centre'))
#filter by admin regions
afrihealthsites('togo', admin_level=1, admin_names=c('Maritime Region', 'Centrale Region'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.