{
  "name": "leaflet R package: task-to-function reference from the package documentation",
  "description": "Maps common mapping tasks to the leaflet function and the arguments used in the package website's own examples, compiled from the markers, choropleths, basemaps and show/hide articles.",
  "page": "https://casrai.org/guides/leaflet-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-17T06:16:20Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Task",
      "unit": "",
      "description": ""
    },
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Arguments shown in the documentation",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documentation article",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Task": "Add default OpenStreetMap background",
      "Function": "addTiles",
      "Arguments shown in the documentation": "(none)",
      "Documentation article": "Introduction"
    },
    {
      "Task": "Centre the map",
      "Function": "setView",
      "Arguments shown in the documentation": "lng, lat, zoom (example: -93.65, 42.0285, zoom = 17)",
      "Documentation article": "Introduction"
    },
    {
      "Task": "Attach an HTML popup at a location",
      "Function": "addPopups",
      "Arguments shown in the documentation": "lng, lat, popup text",
      "Documentation article": "Introduction"
    },
    {
      "Task": "Plot points with click and hover text",
      "Function": "addMarkers",
      "Arguments shown in the documentation": "~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag)",
      "Documentation article": "Markers"
    },
    {
      "Task": "Size and colour circles by data",
      "Function": "addCircleMarkers",
      "Arguments shown in the documentation": "radius = ~ifelse(...), color = ~pal(type), stroke = FALSE, fillOpacity = 0.5",
      "Documentation article": "Markers"
    },
    {
      "Task": "Cluster dense points",
      "Function": "addMarkers",
      "Arguments shown in the documentation": "clusterOptions = markerClusterOptions(freezeAtZoom = 5)",
      "Documentation article": "Markers"
    },
    {
      "Task": "Colour polygons by value",
      "Function": "addPolygons",
      "Arguments shown in the documentation": "fillColor = ~pal(density), weight = 2, opacity = 1, color = \"white\", dashArray = \"3\", fillOpacity = 0.7",
      "Documentation article": "Choropleths"
    },
    {
      "Task": "Bin values into a palette",
      "Function": "colorBin",
      "Arguments shown in the documentation": "palette name \"YlOrRd\", domain, bins",
      "Documentation article": "Choropleths"
    },
    {
      "Task": "Add a legend",
      "Function": "addLegend",
      "Arguments shown in the documentation": "pal, values, opacity = 0.7, title = NULL, position = \"bottomright\"",
      "Documentation article": "Choropleths"
    },
    {
      "Task": "Use a different basemap",
      "Function": "addProviderTiles",
      "Arguments shown in the documentation": "providers$CartoDB.Positron",
      "Documentation article": "Using Basemaps"
    },
    {
      "Task": "Stack semi-transparent tiles",
      "Function": "addProviderTiles",
      "Arguments shown in the documentation": "options = providerTileOptions(opacity = 0.5)",
      "Documentation article": "Using Basemaps"
    },
    {
      "Task": "Let readers toggle layers",
      "Function": "addLayersControl",
      "Arguments shown in the documentation": "baseGroups, overlayGroups, options = layersControlOptions(collapsed = FALSE)",
      "Documentation article": "Show/Hide Layers"
    }
  ],
  "sources": [
    {
      "title": "Leaflet for R: introduction",
      "url": "https://rstudio.github.io/leaflet/",
      "accessed": "2026-11-17"
    },
    {
      "title": "Leaflet for R: Add markers",
      "url": "https://rstudio.github.io/leaflet/articles/markers.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "Leaflet for R: Choropleths",
      "url": "https://rstudio.github.io/leaflet/articles/choropleths.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "Leaflet for R: Using Basemaps",
      "url": "https://rstudio.github.io/leaflet/articles/basemaps.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "Leaflet for R: Show/Hide Layers",
      "url": "https://rstudio.github.io/leaflet/articles/showhide.html",
      "accessed": "2026-11-17"
    }
  ]
}