79313322

Date: 2024-12-28 06:36:09
Score: 0.5
Natty:
Report link

Something like this, though not optimally elegant, nonetheless may work for your purposes:

library(highcharter)

df <- data.frame(
  County = c("Alcona", "Alger"),
  Column_B = c(15, 10),
  Column_C = c(8, 11),
  Column_D = c(26, 13)
)

hcmap(
  "countries/us/us-mi-all",
  data = df,
  value = "Column_B",
  joinBy = c("name", "County"),
  name = "Michigan Counties",
  dataLabels = list(enabled = TRUE, format = "{point.name}"),
  borderColor = "#FAFAFA",
  borderWidth = 0.1,
  tooltip = list(
    pointFormat = "{point.County}<br/>Column B: {point.value}%<br/>Column C: {point.Column_C}%<br/>Column D: {point.Column_D}%"
  )
)

Note that I have made a slight modification to your column names to sanitize them as valid column names (R does not like spaces). This produces the following map + tooltip: Michigan County Choropleth with Tooltip

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: cristian-vargas