| Title: | Comoro Islands Maps |
|---|---|
| Description: | Provides static and interactive maps of the Comoro Islands at four administrative levels: country, island, prefecture, and commune. Includes tools for choropleth visualisation using 'ggplot2' and 'leaflet', and functions to retrieve the underlying spatial datasets as 'sf' objects. |
| Authors: | Housni Hassani [aut, cre] |
| Maintainer: | Housni Hassani <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.6.1 |
| Built: | 2026-06-03 14:11:28 UTC |
| Source: | https://github.com/hhousni/comorosmaps |
Draw a map for Anjouan Island
anjouan(pref = FALSE, city = TRUE)anjouan(pref = FALSE, city = TRUE)
pref |
Choose to map with prefecture area ("pref" = TRUE) or without prefecture area ("pref" = FALSE) |
city |
Include all Anjouan cities as point features ( |
The data set used is in sf format
## Map Anjouan Island. anjouan () ## Map Anjouan Island with prefecture area. anjouan (pref = TRUE)## Map Anjouan Island. anjouan () ## Map Anjouan Island with prefecture area. anjouan (pref = TRUE)
Draw a map of Comoros at the commune level (admin3).
commune(island = "all", city = FALSE)commune(island = "all", city = FALSE)
island |
Filter by island: |
city |
Include capital cities as point features ( |
The data set used is in sf format
## Map all communes commune() ## Map only Grande Comore communes commune(island = "grande comore") ## Map Anjouan communes with cities commune(island = "anjouan", city = TRUE)## Map all communes commune() ## Map only Grande Comore communes commune(island = "grande comore") ## Map Anjouan communes with cities commune(island = "anjouan", city = TRUE)
Draw maps of Comoros Islands.
comoros(x = "country", pref = FALSE, city = FALSE)comoros(x = "country", pref = FALSE, city = FALSE)
x |
Name of the data set to use. The default is |
pref |
Choose to map with prefecture area ("pref" = TRUE) or without prefecture area ("pref" = FALSE) |
city |
Include all cities as point features ( |
comoros()uses the sf package to plot by plotting the geometry rather than every column and leave the plot pref ready for overplotting with other data
The data set used is in sf format
## Map Comoro Islands as one object without prefecture area comoros() ## Map Comoro Islands as one object with prefecture area comoros(x="country",pref=TRUE) ## Map Comoros Islands as 3 object (Grande Comore, Anjouan, Mohéli) without prefecture area. comoros(x="island",pref=FALSE) ## Map Comoros Islands as 3 object (Grande Comore, Anjouan, Mohéli) with prefecture area comoros(x="island",pref=TRUE)## Map Comoro Islands as one object without prefecture area comoros() ## Map Comoro Islands as one object with prefecture area comoros(x="country",pref=TRUE) ## Map Comoros Islands as 3 object (Grande Comore, Anjouan, Mohéli) without prefecture area. comoros(x="island",pref=FALSE) ## Map Comoros Islands as 3 object (Grande Comore, Anjouan, Mohéli) with prefecture area comoros(x="island",pref=TRUE)
A package for mapping Comoro Islands coastline and prefecture area. Data can be drawn or accessed directly as simple features objects.
The package includes simple function for each Island: grandeComore(), anjouan(), moheli() and a function for the country comoros()
Housni Hassani [email protected]
Useful links:
https://github.com/hhousni/comorosmaps
Report bugs at https://github.com/hhousni/comorosmaps/issues
Returns city point features as an sf object.
get_cities(island = "all")get_cities(island = "all")
island |
Filter by island: |
An sf data frame with columns name, adminCode, and geometry.
cities <- get_cities() moheli_cities <- get_cities(island = "moheli")cities <- get_cities() moheli_cities <- get_cities(island = "moheli")
Returns commune (admin3) polygons as an sf object. Useful for custom
spatial analysis, joining your own data, or exporting to GeoJSON/CSV.
get_communes(island = "all")get_communes(island = "all")
island |
Filter by island: |
An sf data frame with columns name, adminCode, and geometry.
communes <- get_communes() anjouan_communes <- get_communes(island = "anjouan")communes <- get_communes() anjouan_communes <- get_communes(island = "anjouan")
Returns prefecture (admin2) polygons as an sf object.
get_prefectures(island = "all")get_prefectures(island = "all")
island |
Filter by island: |
An sf data frame with columns name, adminCode, and geometry.
prefectures <- get_prefectures() gc_prefs <- get_prefectures(island = "grande comore")prefectures <- get_prefectures() gc_prefs <- get_prefectures(island = "grande comore")
Draw a map for Grande Comore Island
grandeComore(pref = FALSE, city = TRUE)grandeComore(pref = FALSE, city = TRUE)
pref |
Choose to map with prefecture area ("pref" = TRUE) or without prefecture area ("pref" = FALSE) |
city |
Include all Grande Comore cities as point features ( |
The data set used is in sf format
## Map Grande Comore Island grandeComore () ## Map Grande Comore with prefecture area grandeComore (pref = TRUE)## Map Grande Comore Island grandeComore () ## Map Grande Comore with prefecture area grandeComore (pref = TRUE)
Draw a map for Moheli Islands
moheli(pref = FALSE, city = TRUE)moheli(pref = FALSE, city = TRUE)
pref |
Choose to map with prefecture area ("pref" = TRUE) or without prefecture area ("pref" = FALSE) |
city |
Include all Mohéli cities as point features ( |
The data set used is in sf format
## Map Moheli Island moheli () ## Map Moheli Island with prefecture area moheli (pref = TRUE)## Map Moheli Island moheli () ## Map Moheli Island with prefecture area moheli (pref = TRUE)
Creates a publication-ready map using ggplot2 with non-overlapping city labels via ggrepel.
plot_map( island = "all", pref = FALSE, commune = FALSE, label_regions = NULL, city = TRUE, title = NULL, data = NULL, var = NULL, join_by = "name", fill_label = NULL )plot_map( island = "all", pref = FALSE, commune = FALSE, label_regions = NULL, city = TRUE, title = NULL, data = NULL, var = NULL, join_by = "name", fill_label = NULL )
island |
Which island to display: |
pref |
Show prefecture boundaries ( |
commune |
Show commune boundaries ( |
label_regions |
Label prefecture or commune names inside their borders
( |
city |
Show city points and labels ( |
title |
Map title. If |
data |
Optional data frame to use for a choropleth fill. Must contain
a column matching region names and a numeric column specified by |
var |
Name of the numeric column in |
join_by |
Name of the column in |
fill_label |
Legend title for the choropleth scale. Defaults to the value of |
A ggplot object.
## Styled map of all islands plot_map() ## Anjouan with prefecture names inside borders plot_map(island = "anjouan", pref = TRUE) ## Anjouan at commune level with names plot_map(island = "anjouan", commune = TRUE)## Styled map of all islands plot_map() ## Anjouan with prefecture names inside borders plot_map(island = "anjouan", pref = TRUE) ## Anjouan at commune level with names plot_map(island = "anjouan", commune = TRUE)
Opens an interactive leaflet map in the viewer or browser. Click polygons to see region names; hover over city markers to see city names.
view_map( island = "all", pref = FALSE, commune = FALSE, city = TRUE, label_regions = TRUE, data = NULL, var = NULL, join_by = "name", fill_label = NULL )view_map( island = "all", pref = FALSE, commune = FALSE, city = TRUE, label_regions = TRUE, data = NULL, var = NULL, join_by = "name", fill_label = NULL )
island |
Which island to display: |
pref |
Show prefecture boundaries ( |
commune |
Show commune boundaries ( |
city |
Show city markers ( |
label_regions |
Show permanent region name labels on polygons ( |
data |
Optional data frame to use for a choropleth fill. |
var |
Name of the numeric column in |
join_by |
Column in |
fill_label |
Legend title for the choropleth scale. Defaults to |
A leaflet map widget.
## Interactive map of all islands ## Not run: view_map() view_map(island = "anjouan", commune = TRUE, city = TRUE) ## End(Not run)## Interactive map of all islands ## Not run: view_map() view_map(island = "anjouan", commune = TRUE, city = TRUE) ## End(Not run)