adarvmapsr: Build an interactive epidemiological spot map for India

View source: R/adarvmapsr.R

adarvmapsrR Documentation

Build an interactive epidemiological spot map for India

Description

Build an interactive epidemiological spot map for India

Usage

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(...)

Arguments

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 TRUE, skip outcome detection and treat every row as a case (no controls on the map). Useful for outbreak surveillance or case-only datasets that don't have a control group. Defaults to FALSE.

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 adarvmapsr() (used by the adarvmaps() alias).

Value

A leaflet widget (invisibly if saved to file).

Examples

## 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)

adarvmapsr documentation built on Nov. 25, 2026, 9:07 a.m.