Contexto

Anotação de como eu preciso fazer.

library(ipeadatar)
library(ggplot2)
library(dplyr)
library(geobr)

Quais as bases disponíveis?

nomeseries<-available_series( )

Como baixar uma base disponível?

consumogasolina <- ipeadata("ANP12_CGASOL12", language="en")

Gráfico

ggplot(consumogasolina, aes(x = date, y = value)) +
  geom_line(color = "steelblue", linewidth = 0.8) +
  geom_point(color = "darkblue", size = 1.5, alpha = 0.7) +
 labs(
    x = "",
    y = "Consumo de Gasolina (quantidade/dia)",
    title = "Evolução do Consumo Aparente de Gasolina",
    subtitle = "",
    caption = "Fonte: ANP - Código ANP12_CGASOL12\nConsumo aparente - gasolina - média - quantidade/dia"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5),
    axis.title = element_text()
  )

consumoalcool <- ipeadata("ANP12_CALCO12", language="en")
ggplot(consumoalcool, aes(x = date, y = value)) +
  geom_line(color = "steelblue", linewidth = 0.8) +
  geom_point(color = "darkblue", size = 1.5, alpha = 0.7) +
 labs(
    x = "",
    y = "Consumo de Àlcool (quantidade/dia)",
    title = "Evolução do Consumo Aparente de Alcool",
    subtitle = "",
    caption = "Fonte: ANP - Código ANP12_CALCO12\nConsumo aparente - álcool - média - quantidade/dia"
  ) +
  theme_minimal() +
  theme(
    plot.title = element_text(hjust = 0.5),
    axis.title = element_text()
  )