| adarvmapsr | R Documentation |
Build an interactive epidemiological spot map for India
adarvmapsr(
data,
state_shp = NULL,
district_shp = NULL,
lat_col = NULL,
lon_col = NULL,
outcome_col = NULL,
case_value = NULL,
all_cases = FALSE,
count_cutoff = 2L,
margin_deg = 1,
cluster_color = "#E85252",
case_color = "#D55757",
control_color = "#7676E7",
case_label = NULL,
control_label = NULL,
output = NULL
)
adarvmaps(...)
data |
Path to a CSV/Excel/TSV file, or a data.frame. |
state_shp |
Optional custom state boundary file path. |
district_shp |
Optional custom district boundary file path. |
lat_col |
Latitude column name. Auto-detected when NULL. |
lon_col |
Longitude column name. Auto-detected when NULL. |
outcome_col |
Outcome column name. Auto-detected when NULL. |
case_value |
Value representing a case. Auto-detected when NULL. |
all_cases |
If |
count_cutoff |
District count threshold for zoom level (default 2). |
margin_deg |
Padding in degrees around bounding box (default 1.0). |
cluster_color |
Hex colour for dot-density clusters. |
case_color |
Hex colour for case pins. |
control_color |
Hex colour for control pins. |
case_label |
Word shown for the main group on the map (legend, pop-ups, menu). Defaults to the actual value from the grouping column (e.g. "Dead"). Pass a string only to override. |
control_label |
Word shown for the other group. Defaults to the other value in the grouping column when there is exactly one (e.g. "Alive"), otherwise "Others". Pass a string only to override. |
output |
Path to save the HTML file. If NULL, returns the leaflet widget. |
... |
Arguments passed on to |
A leaflet widget (invisibly if saved to file).
## Not run:
adarvmapsr("cases.csv", output = "map.html")
# Or with a data.frame
adarvmapsr(my_df, lat_col = "lat", lon_col = "lon",
outcome_col = "status", case_value = "case")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.