I am trying to make a point map that replaces the points with pie charts to make the information quicker to understand for the layman.
the alternative is:
"text": statistic "text": statistic "text": statistic "text": statistic
library(shiny)
library(shinydashboard)
library(tidyverse)
library(shinyWidgets)
library(plotly)
library(leaflet)
library(scales)
library(sp)
library(sf)
library(ggplot2)
library(leaflet.minicharts)
ui <- dashboardPage( skin = "purple",
dashboardHeader(title = "Practice Map", titleWidth = 400),
dashboardSidebar(disable = TRUE),
dashboardBody(
fluidPage(
useShinydashboard(),
fluidRow(
leafletOutput(outputId = "map")
)
)))
server <- function(input, output) {
output$map <- renderLeaflet ({
#extracting coordinates and adding to data
map.tb <- map%>%
st_coordinates() %>%
as_tibble() %>%
rename(lon = 1, lat = 2) %>%
bind_cols(map %>% st_drop_geometry())
l <- leaflet(map) %>%
addTiles() %>%
addMinicharts(
lng = map.tb$lon,
lat = map.tb$lat,
type = pie,
chartdata = map.tb[,c(column1,column2,
column3,column4)],
width = 60 * sqrt(map$colmun1) / sqrt(max(map$column1)), transitionTime = 0,
fillColor = d3.schemeCategory10[1],
colorPalette = d3.schemeCategory10
I keep getting this error.
Error in match.arg: 'arg' must be NULL or a character vector
does this mean I am missing an argument somewhere?
Let me know if any info is missing.