Tilbage


Delmål 8: Anstændige jobs og økonomisk vækst

BNP per indbygger


FN 8.1.1 Årlig realvækst i BNP pr. indbygger
# Import
NRX10_raw <-
  statgl_url("NRX10", lang = language) %>% 
  statgl_fetch(
    units     = "K",
    account   = "02",
    Aar       = px_all(),
    .col_code = TRUE
               ) %>% 
  as_tibble()

# transform 
NRX10 <- 
  NRX10_raw %>% 
  rename("time" = "Aar") %>% 
  mutate(time = time %>% as.numeric()) %>% 
  mutate(value = (value - lag(value)) / lag(value))


NRX10 %>% 
  ggplot(aes(
    x = time,
    y = value,
    fill = account
  )) +
  geom_col() +
  scale_fill_statgl() + 
  theme_statgl() +
  theme(legend.position = "none") +
  scale_y_continuous(labels = scales::percent_format(
    scale        = 100, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig1$title[language],
    subtitle = NRX10[[1]][1],
    x        = " ",
    y        = sdg8$fig$fig1$y_lab[language],
    fill     = " ",
    caption  = sdg8$fig$fig1$cap[language]
  )

Statistikbanken, BNP

Statistikbanken, beskæftigede


tab <- 
  NRX10 %>% 
  mutate(value = value*100) %>% 
  filter(time >= max(time) - 5) %>% 
  arrange(desc(time)) %>% 
  select(-account) %>% 
  mutate(time = time %>% as.character())


if(language != "en"){
  
  table <- 
    tab %>% 
    select(-units) %>% 
    mutate(value = value %>% round(1)) %>% 
    rename(" " = 1, "Realvækst" = value) %>% 
    statgl_table() %>% 
    pack_rows(index = tab[[1]] %>% table()) %>% 
    add_footnote(sdg8$fig$fig1$foot1[language], notation = "symbol")
  
} else {
  
   table <- 
    tab %>% 
    select(-units) %>% 
    mutate(value = value %>% round(1)) %>% 
    rename(" " = 1, "Real growth rate" = value) %>% 
    statgl_table() %>% 
    pack_rows(index = tab[[1]] %>% table()) %>% 
    add_footnote(sdg8$fig$fig1$foot1[language], notation = "symbol")

}


table
Realvækst
2010-priser, kædede værdier
2020 0,2
2019 2,1
2018 0,6
2017 0,0
2016 5,5
2015 -2,5
* Realvækst i procent, BNP per indbygger

Beskæftigelse


GS Beskæftigelsesgrad i forhold til samlet befolkning
# Import
ARXBFB5_raw <-
  statgl_url("ARXBFB5", lang = language) %>% 
  statgl_fetch(
    time                 = px_all(),
    municipality         = px_all(),
    "inventory variable" = 2,
    .col_code            = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXBFB5 <- 
  ARXBFB5_raw %>% 
  mutate(time = time %>% make_date(),
         municipality = municipality %>% factor(levels = unique(municipality)))

# Plot
ARXBFB5 %>% 
  filter(municipality == ARXBFB5[[2]][1]) %>% 
  ggplot(aes(
    x = time,
    y = value
    )) +
  geom_line(size = 2) +
  facet_wrap(~ municipality, scales = "free") +
    scale_y_continuous(labels = scales::percent_format(
      scale      = 1, 
      accuracy   = 1, 
      big.mark   = ".",
      decimal.mark = ","
      )) +
  theme_statgl() + scale_fill_statgl() +
  theme(legend.position = "none") +
  labs(
    title    = sdg8$fig$fig2$title[language],
    subtitle = ARXBFB5[[3]][1],
    x        = " ",
    y        = " ",
    caption  = sdg8$fig$fig2$cap[language]
  )

Statistikbanken

Metode


# Transform
ARXBFB5 <- 
  ARXBFB5_raw %>% 
  filter(
    municipality == ARXBFB5_raw[[2]][1],
    time         >= year(Sys.time()) - 7
    ) %>% 
  arrange(desc(time))

vec        <- 1:2
names(vec) <- c(" ", sdg8$fig$fig2$cols$col2[language])

# Table
ARXBFB5 %>% 
  select(1, ncol(.)) %>% 
  rename(vec) %>% 
  statgl_table() %>% 
  pack_rows(index = ARXBFB5[[3]] %>% table()) %>% 
  add_footnote(ARXBFB5[[2]][1], notation = "symbol")
Beskæftigelsesgrad
Beskæftiget mindst én måned i forhold til samlet befolkning (pct.)
2020 79
2019 80
2018 80
2017 80
2016 80
2015 78
* Hele landet (inkl. uden for kommunal inddeling)

Ledighed


FN 8.5.2 Ledighedsgrad fordelt på alder
# Import
ARXLED4_raw <-
  statgl_url("ARXLED4", lang = language) %>% 
  statgl_fetch(
    time      = px_all(),
    district  = "0",
    quarter   = "0",
    age       = "0",
    .col_code = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXLED4 <-
  ARXLED4_raw %>% 
  mutate(time = time %>% make_date()) %>% 
  unite(combi, 1, 2, 3, sep = ", ")

# Plot
ARXLED4 %>% 
  ggplot(aes(
    x = time,
    y = value
    )) +
  geom_line(size = 2) +
  theme_statgl() + 
  scale_color_statgl() +
  theme(legend.position = "none") +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig3$title[language],
    subtitle = ARXLED4[[1]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig3$cap[language]
  )

Statistikbanken

Metode


# Transform

vec        <- 5
names(vec) <- sdg8$fig$fig3$cols$ncol[language]

ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(time >= year(Sys.time()) - 6) %>% 
  arrange(desc(time)) %>% 
  rename(vec) %>% 
  unite(combi, 2, 3, sep = ", ")

# Table
ARXLED4 %>% 
  select(1, ncol(.)) %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  pack_rows(index = ARXLED4[[3]] %>% table()) %>% 
  add_footnote(ARXLED4[[2]][1], notation = "symbol")
Ledighedsprocent
2016
Hele året 5,3
2017
Hele året 5,1
2018
Hele året 5,8
2019
Hele året 6,8
2020
Hele året 7,3
* Hele landet, Alle (18-65 år)



# Import
ARXLED4_raw <-
  statgl_url("ARXLED4", lang = language) %>% 
  statgl_fetch(
    time      = px_all(),
    district  = "0",
    quarter   = "0",
    age       = px_all(),
    .col_code = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(age != ARXLED4_raw[[3]][1]) %>% 
  arrange(desc(time)) %>% 
  mutate(age = age %>% factor(levels = unique(age)),
         time = time %>% make_date()) %>% 
  unite(combi, 1, 2, sep = ", ")

# Plot
ARXLED4 %>% 
  ggplot(aes(
    x     = time, 
    y     = value,
    color = age
    )) +
  geom_line(size = 2) +
  theme_statgl() + 
  scale_color_statgl() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig4$title[language],
    subtitle = ARXLED4[[1]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig4$cap[language]
  )

Statistikbanken

Metode


# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(
    age != ARXLED4_raw[[4]][1],
    time >= year(Sys.time()) - 6
    ) %>% 
  arrange(desc(time)) %>% 
  mutate(
    age = age %>% factor(levels = unique(age)),
    time = time %>% factor(levels = unique(time))
    ) %>% 
  unite(combi, 2, 3, sep = ", ") %>% 
  spread(1, ncol(.))

vec        <- ARXLED4[[2]] %>% length()
names(vec) <- sdg8$fig$fig4$index[language]

# Table
ARXLED4 %>% 
  select(-1) %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  pack_rows(index = vec) %>% 
  add_footnote(ARXLED4[[1]][1], notation = "symbol")
Hele året
Ledighedsprocent
2020 8,6
2019 6,8
2018 9,9
2017 13,3
2016 16,0
2020 7,7
2019 7,8
2018 9,5
2017 10,9
2016 11,4
2020 5,3
2019 5,6
2018 6,3
2017 7,9
2016 9,0
2020 5,0
2019 4,8
2018 5,3
2017 6,7
2016 7,1
2020 5,0
2019 4,6
2018 5,4
2017 6,7
2016 6,5
2020 4,8
2019 4,4
2018 4,6
2017 4,8
2016 5,4
2020 4,4
2019 4,7
2018 4,8
2017 5,8
2016 6,7
2020 5,3
2019 4,9
2018 5,3
2017 6,2
2016 6,4
2020 5,1
2019 4,5
2018 5,1
2017 5,7
2016 6,0
2020 5,3
2019 5,1
2018 5,8
2017 6,8
2016 7,3
2020 5,0
2019 4,8
2018 5,4
2017 5,3
2016 5,4
* Hele landet, 18-19 år
GS Ledighedsprocent efter bosted
# Import
ARXLED4_raw <-
  statgl_url("ARXLED4", lang = language) %>% 
  statgl_fetch(
    time                  = px_all(),
    "place of residence"  = px_all(),
    quarter               = "0",
    age                   = "0",
    .col_code             = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
    mutate(time = time %>% make_date()) %>% 
  unite(combi, quarter, age, sep = ", ")

# Plot
ARXLED4 %>% 
  ggplot(aes(
    x     = time,
    y     = value, 
    color = `place of residence`
    )) +
  geom_line(size = 2) +
  theme_statgl() + 
  scale_color_statgl() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig5$title[language],
    subtitle = ARXLED4[[2]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig5$cap[language]
    )

Statistikbanken

Metode


# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(time >= year(Sys.time()) - 6) %>% 
  arrange(desc(time)) %>% 
  mutate(time = time %>% factor(levels = unique(time))) %>% 
  unite(combi, quarter, age, sep = ", ") %>% 
  spread(1, ncol(.))

vec        <- ARXLED4[[1]] %>% length()
names(vec) <- sdg8$fig$fig5$index[language]

# Table
ARXLED4 %>% 
  select(-1) %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  add_footnote(ARXLED4[[1]][1], notation = "symbol") %>% 
  row_spec(1, bold = TRUE) %>% 
  pack_rows(index = vec)
Hele året, Alle (18-65 år)
Ledighedsprocent
2020 5,3
2019 5,1
2018 5,8
2017 6,8
2016 7,3
2020 4,9
2019 4,7
2018 5,4
2017 6,4
2016 7,0
2020 8,5
2019 8,1
2018 9,0
2017 10,0
2016 9,6
* Alle



Forskning og udvikling


GS Udgifter til forskning og udvikling som andel af BNP
# Import
NRX09_raw <-
  statgl_url("NRX09", lang = language) %>%
  statgl_fetch(
    "units"   = "L",
    "account" = px_all(),
    "time"    = px_all(),
    .col_code = TRUE
    ) %>% 
  as_tibble()

NRX09_raw <- NRX09_raw %>% filter(account %in% unique(NRX09_raw %>% pull(account))[7])

NRX10_raw <-
  statgl_url("NRX10", lang = language) %>% 
  statgl_fetch(
    "units"    = "L",
    "account"  = "01",
    "Aar"      = px_all(),
    .col_code = TRUE
    ) %>% 
  as_tibble()

# Transform
RD_GDP <- 
  NRX10_raw %>% 
  select(3:4) %>% 
  rename(
    "time" = 1,
    "GDP"  = 2
    ) %>% 
  left_join(
    NRX09_raw %>% 
      mutate(account = account %>% str_remove_all("[:digit:]") %>% trimws()) %>% 
      select(3:4) %>% 
      rename("RD" = 2)
    ) %>% 
  mutate(pct = RD / GDP) %>% 
  filter(pct != "NA")

# Plot
RD_GDP %>% 
  ggplot(aes(
    x = time,
    y = pct
    )) +
  geom_col() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 100, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  theme_statgl() + 
  scale_fill_statgl() +
  theme(legend.position = "none") +
  labs(
    title    = sdg8$fig$fig6$title[language],
    subtitle = NRX09_raw[[1]][1],
    x        = " ",
    y        = sdg8$fig$fig6$y_lab[language],
    caption  = sdg8$fig$fig6$cap[language]
  )

Statistikbanken, investeringer (forskning og udvikling)

Statistikbanken, BNP


# Transform
tab <- 
  RD_GDP %>% 
  arrange(desc(time)) %>% 
  filter(time >= year(Sys.time()) - 7) %>% 
  mutate(
    time = time %>% fct_inorder(),
    pct  = pct * 100,
    pct  = pct %>% round(1),
    var  = sdg8$fig$fig6$cols$col1[language]
    ) %>% 
  select(-(2:3)) %>% 
  spread(1, 2)

# Table
tab %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  pack_rows(index = table(NRX09_raw[[1]][1])) %>% 
  add_footnote(sdg8$fig$fig6$foot[language], notation = "symbol")
2020 2019 2018 2017 2016 2015
Løbende priser
Udgifter til forskning og udvikling 1,6 1,8 1,8 2,1 2,1 2,3
* Procentvis andel af BNP

Udenrigspassagerer


GS Antal udenrigspassagerer på rutefly
# Import
TUXUPAX_raw <-
  statgl_url("TUXUPAX", lang = language) %>%
  statgl_fetch(airport   = 0,
               month     = 0,
               time      = px_all(),
               .col_code = TRUE) %>% 
  as_tibble()

# Transform
TUXUPAX <-
  TUXUPAX_raw %>% 
  mutate(value = value / 1000,
         time = time %>% make_date())

# Plot
TUXUPAX %>% 
  ggplot(aes(
    x    = time,
    y    = value, 
    fill = airport
    )) +
  geom_col() +
  theme_statgl() + 
  scale_fill_statgl() +
  theme(plot.margin = margin(10, 10, 10, 10),
        legend.position = "none") +
  labs(
    title = sdg8$fig$fig7$title[language],
    x = " ",
    y = sdg8$fig$fig7$y_lab[language],
    caption = sdg8$fig$fig7$cap[language]
  )

Statistikbanken

Metode


# Transform
TUXUPAX <-
  TUXUPAX_raw %>% 
  mutate(value = value) %>% 
  filter(time >= year(Sys.time()) - 7,
         value != "NA") %>% 
  arrange(desc(time))

vec <- 1:2
names(vec) <- c(" ",  sdg8$fig$fig7$cols$col2[language])


# Table
TUXUPAX %>% 
  select(-(1:2)) %>% 
  rename(vec) %>% 
  statgl_table() %>% 
  add_footnote(sdg8$fig$fig7$foot[language],
               notation = "symbol")
Udenrigspassagerer på rutefly
2021 39.293
2020 30.785
2019 86.989
2018 85.306
2017 83.487
2016 80.806
2015 75.320
* Antal personer.

Ungemålgruppe


GS Ungemålgruppe
UDXUMG3_raw <- 
  statgl_url("UDXUMG3", lang = language) %>%
  statgl_fetch(
    age       = px_all(),
    status    = 5:7,
    time      = px_all(),
    .col_code = TRUE
  ) %>% 
  as_tibble()

#sdg8 <- read_yaml("S:/STATGS/VM/SDG_dokument/input/text/txt_08.yml")

lab_vec        <- 1:5
names(lab_vec) <- 
  c(
    "age",
    "time",
    sdg8$fig$fig8$tags$tag1[language] %>% unlist(),
    sdg8$fig$fig8$tags$tag2[language] %>% unlist(),
    sdg8$fig$fig8$tags$tag3[language] %>% unlist()
)


UDXUMG3 <-
  UDXUMG3_raw %>% 
  mutate(status = status %>% fct_inorder()) %>% 
  spread(status, value) %>% 
  rename(
    "age"   = 1,
    "time"  = 2,
    "work"  = 3,
    "none"  = 4,
    "total" = 5
  ) %>% 
  mutate(edu = total - work - none) %>% 
  select(-total) %>% 
  rename(lab_vec) %>% 
  gather(status, value, -c(age, time)) %>% 
  mutate(time = time %>% as.numeric()) %>% 
  filter(time %in% c(min(time), mean(time), max(time))) %>%
  mutate(time = time %>% as.character() %>% fct_rev())
  

UDXUMG3 %>%
  ggplot(aes(
    x    = parse_number(age),
    y    = value,
    fill = status
  )) +
  geom_col(position = "fill") +
  facet_wrap(~ time) + 
  scale_x_continuous(labels = function(x) round(x)) +
  scale_y_continuous(labels = scales:: percent) + 
  scale_fill_statgl(reverse = TRUE) +
  theme_statgl() + 
  labs(
    title    = sdg8$fig$fig8$title[language],
    subtitle = sdg8$fig$fig8$sub[language],
    x        = sdg8$fig$fig8$x_lab[language],
    y        = " ",
    color    = colnames(UDXUMG3_raw)[2] %>% str_to_title(),
    caption  = sdg8$fig$fig8$cap[language]
)

Statistikbanken

Metode


tab <- 
  UDXUMG3 %>% 
  mutate(age = age %>% fct_inorder()) %>% 
  arrange(age, time, status) %>% 
  unite(combi, time, status, sep = ",") %>% 
  mutate(combi = combi %>% fct_inorder()) %>% 
  spread(combi, value)

vec      <- tab %>% select(-1) %>% colnames() %>% str_split(",") %>% unlist()
head_vec <- vec[c(TRUE, FALSE)] %>% table() %>% rev()
col_vec  <- vec[c(FALSE, TRUE)]

tab %>% 
  statgl_table(col.names = c(" ", col_vec)) %>% 
  add_header_above(c(" ", head_vec)) %>% 
  add_footnote(sdg8$fig$fig8$foot[language], notation = "symbol")
2020
2015
2010
Hverken I beskæftigelse Under uddannelse Hverken I beskæftigelse Under uddannelse Hverken I beskæftigelse Under uddannelse
16 år 292 89 347 347 93 337 411 154 355
17 år 314 126 286 357 129 315 399 201 302
18 år 304 211 273 392 205 303 404 245 298
19 år 274 243 247 330 241 250 371 251 341
20 år 266 267 178 303 307 234 349 310 308
21 år 248 333 153 303 344 217 354 356 252
22 år 249 349 193 288 399 231 339 337 272
23 år 275 420 183 267 390 254 267 366 238
24 år 256 397 172 275 406 228 266 352 206
25 år 242 436 187 271 432 235 278 397 182
* Antal personer