Tilbage


Delmål 12: Ansvarligt forbrug og produktion

Eldrevne biler


GS Eldrevne biler
# Import
url <- paste0("https://bank.stat.gl/api/v1/", language, "/Greenland/EN/EN40/ENXMO5FU.px")

elbiler_raw <- 
  url |>  
  statgl_fetch(
    time      = px_all(),
    category  = px_all(),
    .col_code = T
  ) |> 
  as_tibble()

# Transform
elbiler <- 
  elbiler_raw |> 
  filter(category != elbiler_raw[[1]][1])

# Plot
elbiler %>% 
  ggplot(aes(
    x    = time,
    y    = value,
    fill = category
  )) +
  geom_col() +
  theme_statgl() + 
  scale_fill_statgl(reverse = T) +
  labs(
    title   = sdg13$figs$fig4$title[language],
    y       = sdg13$figs$fig4$y_lab[language],
    x       = " ",
    fill    = " ",
    caption = sdg13$figs$fig4$cap[language]
  )

Statistikbanken


# Table
tab <- 
  elbiler_raw %>% 
  mutate(time = time %>% factor(levels = unique(time))) %>% 
  spread(time, value) %>% 
  mutate(across(2:8 , ~ if_else(is.na(.x), 0, .x)))

tab %>% 
  rename(" " = 1) %>% 
  statgl_table(replace_0s = T) |> 
  row_spec(1, bold = T)
2016 2017 2018 2019 2020 2021 2022
El- og hybridbiler i alt 191 341 482 643 977 1.466 1.642
Elbiler 191 341 482 643 747 841 727
Hybridbiler 0 0 0 0 27 71 105
Hybridbiler med plug-in 0 0 0 0 203 554 810