Description Usage Arguments Value Examples
View source: R/compare_hs_sources.r
main aim to plot map comparing different sources
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | compare_hs_sources(
country,
datasources = c("healthsites", "who"),
plot = "mapview",
plotshow = TRUE,
plotcex = c(6, 4),
col.regions = list(RColorBrewer::brewer.pal(9, "YlGn"), RColorBrewer::brewer.pal(9,
"BuPu")),
alpha = c(0.1, 0.1),
alpha.regions = c(0.7, 0.7),
layer.names = NULL,
plotlegend = TRUE,
hs_amenity = "all",
who_type = "all",
canvas = FALSE,
plotlabels1 = FALSE,
plotlabels2 = FALSE,
map.types = c("CartoDB.Positron", "OpenStreetMap.HOT"),
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. |
datasources |
vector of 2 datasources from 'healthsites' predownloaded, 'who', 'healthsites_live' needs API, 'hdx' not working yet |
plot |
option to display map 'mapview' for interactive, 'sf' for static |
plotshow |
whether to show the plot, otherwiser just return plot object |
plotcex |
sizes of symbols for each source default=c(6,3), helps view symbol overlap |
col.regions |
list of two colour palettes to pass to mapview |
alpha |
list of two alphas to pass to mapview - low keeps borders light |
alpha.regions |
list of two alpha.regions to pass to mapview |
layer.names |
allow mapview layer.names to be set c('a','b') |
plotlegend |
whether to add legend to mapview plot |
hs_amenity |
filter healthsites data by amenity. 'all', 'clinic', 'dentist', 'doctors', 'pharmacy', 'hospital' |
who_type |
filter by Facility type |
canvas |
mapview plotting option, TRUE by default for better performance with larger data |
plotlabels1 |
whether to add static labels for source1 |
plotlabels2 |
whether to add static labels for source2 |
map.types |
optional specification of background map tiles for mapview, default c('CartoDB.Positron','OpenStreetMap.HOT') |
type_column |
just for user provided files which column has information on type of site, default : 'Facility Type' |
label_column |
just 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
1 2 3 4 5 | #compare_hs_sources("nigeria", datasources=c('who', 'healthsites'), plot='mapview')
#compare_hs_sources(c('malawi','zambia'))
#filter by admin regions
compare_hs_sources('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.