#carrega bibliotecas
# library(ggplot2)
# library(tidyverse)
# library(sf)
# library(geobr)
# library(ggpubr)
# 
# #le os dados do csv
# M12 <- read.csv("C:/Dados/PNE/META_12_2020.CSV", header = TRUE, sep =";")
# 
# #funcao para converter virgulas em pontos
# comma_to_points <- function(x) as.numeric((str_replace(x, ",", ".")))
# 
# #transforma apenas as variaveis dos anos em numeros
# M12 <- M12 %>% 
#   mutate_at(vars(contains('_20')), comma_to_points)
# 
# dput(M12)

Dados reprodutíveis:

#carrega bibliotecas
library(ggplot2)
library(tidyverse)
library(sf)
library(geobr)
library(ggpubr)


df <- structure(list(CO_UF = c(11L, 12L, 13L, 14L, 15L, 16L, 17L, 21L, 
22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 31L, 32L, 33L, 35L, 41L, 
42L, 43L, 50L, 51L, 52L, 53L), NO_UF = c("Rondônia", "Acre", 
"Amazonas", "Roraima", "Pará", "Amapá", "Tocantins", "Maranhão", 
"Piauí", "Ceará", "Rio Grande do Norte", "Paraíba", "Pernambuco", 
"Alagoas", "Sergipe", "Bahia", "Minas Gerais", "Espírito Santo", 
"Rio de Janeiro", "São Paulo", "Paraná", "Santa Catarina", "Rio Grande do Sul", 
"Mato Grosso do Sul", "Mato Grosso", "Goiás", "Distrito Federal"), TBM_2012 = c(29, 29.3, 30.3, 47.8, 18.9, 35.9, 25.9, 17.3, 27.3, 23.3, 25.5, 29.2, 24.5, 22.6, 29.5, 22.3, 30.4, 33.4, 32.9, 36.6, 35.8, 37.5, 40.2, 39.8, 37.9, 33.7, 57.8), TBM_2019 = c(39, 35.6, 33.2, 41.4, 29.1, 45, 33, 26.3, 37.2, 34.4, 36.7, 33.6, 
29.2, 24.3, 28.9, 28.3, 38.2, 37.6, 43.9, 39.5, 42, 46.1, 45.8, 
38.2, 41.8, 42.2, 58.5), TLE_2012 = c(17.4, 16.8, 15.1, 25.8, 
10, 19.3, 16.2, 9, 17.6, 14.7, 14.6, 17.6, 14.7, 12.7, 18.9, 
10.8, 19.4, 21.6, 20.4, 25.8, 27.6, 27.6, 23.9, 24.1, 23.6, 24.2, 
37.9), TLE_2019 = c(26.1, 24.1, 21.5, 26.8, 17.3, 34.4, 22.2, 
15.9, 25.4, 22.9, 23.7, 22.5, 20.4, 16.6, 18.5, 16.4, 24.5, 24.1, 
28.2, 30.1, 31.1, 33.7, 28.2, 24.8, 25.6, 30.9, 42.2, NA)), class = "data.frame", row.names = c(NA, 
-27L))

UF <- read_state(year=2019)

UF <- dplyr::left_join(UF, df, by = c("code_state" = "CO_UF"))
TB12 <- ggplot() +
    geom_sf(data=UF, aes(fill=TBM_2012), color= NA, size=.15) +
      labs(title="2012") +
        scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(10,60)) +
      theme_minimal() +
      theme(
        plot.title = element_text(size=12, hjust = 0.5),
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())


TB19 <- ggplot() +
    geom_sf(data=UF, aes(fill=TBM_2019), color= NA, size=.15) +
       labs(title="2019") +
        scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(10,60)) +
      theme_minimal() +
      theme(
        plot.title = element_text(size=12, hjust = 0.5),
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())

TBM 2002 e 2019

ggarrange(TB12, TB19, common.legend = TRUE, legend = "bottom")

#scale_fill_distiller(palette = "Blues", name="", limits = c(0,60)) +
#axis.line=element_blank(), axis.ticks=element_blank(), axis.title.x=element_blank(), axis.title.y=element_blank(), panel.background=element_blank(), panel.border=element_blank(),panel.grid.minor=element_blank(), plot.background=element_blank()
UF <- UF %>% 
  mutate(VAR_TBM = (TBM_2019-TBM_2012),
         VAR_TLE = (TLE_2019-TLE_2012))

Variação TBM 2002-2019

ggplot() +
    geom_sf(data=UF, aes(fill=VAR_TBM), color= NA, size=.15) +
      #labs(title="2019") +
        scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(-7,14), breaks = c(-7, 0, 7, 14)) +
      theme_minimal() +
      theme(
        #plot.title = element_text(size=12, hjust = 0.5),
        legend.position="bottom",
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())

TL12 <- ggplot() +
    geom_sf(data=UF, aes(fill=TLE_2012), color= NA, size=.15) +
        scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(9,45)) +
    labs(title="2012") +  
    theme_minimal() +
      theme(
        plot.title = element_text(size=12, hjust = 0.5),
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())


TL19 <- ggplot() +
    geom_sf(data=UF, aes(fill=TLE_2019), color= NA, size=.15) +
      scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(9,45)) +
  labs(title="2019") +  
    theme_minimal() +
      theme(
        plot.title = element_text(size=12, hjust = 0.5),
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())

TLE 2002 e 2019

ggarrange(TL12, TL19, common.legend = TRUE, legend = "bottom")

Variação TLE 2012-2019

ggplot() +
    geom_sf(data=UF, aes(fill=VAR_TLE), color= NA, size=.15) +
      #labs(title="2019") +
        scale_fill_gradient(low = '#f7fcfd', high = '#00441b', name="", limits = c(-1,16), breaks = c(-1, 4, 9, 14)) +
      theme_minimal() +
      theme(
        #plot.title = element_text(size=12, hjust = 0.5),
        legend.position="bottom",
        axis.text.x=element_blank(), axis.text.y=element_blank(), panel.grid.major=element_blank())