renderPlot({
filter(area_plantadag, consorcio == input$consorcio) %>%
ggplot(., aes(x=produto, y = area_plantada,fill= produto)) +
geom_bar(stat="identity",position = position_dodge(width = 1),width= 0.25)+
geom_text(aes(label=area_plantada), color="black",
position = position_dodge(0.5),size=4,vjust=0,hjust=0.5)+
ylab("Área Plantada(hectares)") +
xlab("Consórcio") +
theme_minimal()
})
library(dplyr)
library(RColorBrewer)
library(rgdal)
library(readr)
library(descr)
pal <- colorNumeric(
palette = "Accent",
domain = municipiosmt$cores)
municipiosmt$labels <- paste0("<strong> Municipio: </strong>",
municipiosmt$nome,
"<br><strong> Região Sistema FAMATO: </strong>",
municipiosmt$regiao,
"<br><strong> Área Plantada de Soja: </strong>",
municipiosmt$soja)%>%
lapply(htmltools::HTML)
leaflet(municipiosmt) %>%
addTiles() %>%
addPolygons(fillColor = ~pal(municipiosmt$cores),
smoothFactor = 0.5,
fillOpacity = 0.8,
weight = 1,
color = "white",
label = ~labels,
highlight = highlightOptions(
color = "white",
bringToFront = TRUE
))