# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
NRD02_raw <-
read_csv("https://bank.stat.gl:443/sq/fa64de60-cff3-4b69-9dba-a00f1ab03ab4", locale = locale(encoding = "latin1"))
# Transform
NRD02 <-
NRD02_raw %>%
spread(kontonavn, `Konto 2.1.1: Indkomstdannelse`) %>%
mutate(pct =`6 Aflønning af ansatte (residente producenters udgifter)` * `1 Bruttonationalprodukt BNP`^-1,
tid = strtoi(tid) %>% make_date())
NRD02_plot <-
NRD02 %>%
ggplot(aes(x = tid, y = pct, color = enhed)) +
geom_line(size = 2) +
scale_y_continuous(labels = scales::percent_format(scale = 100, accuracy = 1, big.mark = ".",
decimal.mark = ",")) +
theme_statgl() + scale_color_statgl() +
theme(legend.position = "none") +
labs(
title = "Arbejdskraftens andel af BNP",
subtitle = "Aflønning af ansatte (residente producenters udgifter) over BNP i løbende priser",
x = " ",
y = " ",
caption = "Kilde: http://bank.stat.gl/NRD02"
)
NRD02_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
INDF1_2_raw <-
pxweb_get(
url = "https://bank.stat.gl:443/api/v1/da/Greenland/IN/IN40/INXIU101.px",
query = list(
"time" = c("*"),
"indicator" = c("*")
)) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transformation
INDF1_2 <-
INDF1_2_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date())
# Plot
INDF1_2_plot <-
INDF1_2 %>%
filter(ulighedsmål == "Gini-koefficient") %>%
ggplot(aes(x = tid,
y = `Ulighedsmål målt på ækvivaleret disponibel indkomst`,
color = ulighedsmål)) +
geom_line(size = 2) +
scale_color_statgl() +
theme_statgl() +
theme(legend.position = "none") +
labs(
title = "Gini-koefficienten",
subtitle = "Mål for fordelingen af alle indkomster (0 = fuldstændig ligelige fordeling, 100 = fuldstændig ulige fordeling)",
x = " ",
y = "Gini-point",
color = "Mål",
caption = "Kilde: https://bank.stat.gl/INDF1"
)
INDF1_2_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
INDF1_3_raw <-
pxweb_get(
url = "https://bank.stat.gl:443/api/v1/da/Greenland/IN/IN40/INXIU101.px",
query = list(
"time" = c("*"),
"indicator" = c("*")
)
) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transform
INDF1_3 <-
INDF1_3_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date())
# Plot
INDF1_3_plot <-
INDF1_3 %>%
filter(ulighedsmål == "S80/20") %>%
ggplot(aes(x = tid,
y = `Ulighedsmål målt på ækvivaleret disponibel indkomst`,
color = ulighedsmål)) +
geom_line(size = 2) +
scale_y_continuous(labels = scales::unit_format(
suffix = " ",
big.mark = ".",
decimal.mark = ","
)) +
scale_color_statgl() +
theme_statgl() +
theme(legend.position = "none") +
labs(
title = "S80/20",
subtitle = "Forholdet mellem de 20% højeste indkomster over de 20 % laveste indkomster",
x = " ",
y = "S80/20-ratio",
color = "Mål",
caption = "Kilde: https://bank.stat.gl/INDF1"
)
INDF1_3_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
soD004_raw <-
pxweb_get(
url = "https://bank.stat.gl/api/v1/da/Greenland/SO/SO20/SOX004.px",
query = list(
"age" = c("*"),
"municipality" = c("*"),
"gender" = c("*"),
"unit" = c("Antal"),
"type" = c("10"),
"time" = c("*")
)) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transform
soD004 <-
soD004_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date(),
`Offentlig hjælp` = (`Offentlig hjælp` / 1000))
# Plot
soD004_plot <-
soD004 %>%
filter(alder == "I alt", kommune == "I alt", køn == "I alt") %>%
ggplot(aes(x = tid,
y = `Offentlig hjælp`,
fill = enhed)) +
geom_col() +
theme_statgl() + scale_fill_statgl() +
theme(legend.position = "none") +
labs(
title = "Offentlig hjælp",
subtitle = "Antal personer der modtager offentlig hjælp, et tidspunkt i løbet af året",
x = " ",
y = "Tusinde personer",
fill = " ",
caption = "Kilde: https://bank.stat.gl/soD004"
)
soD004_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
soD010_raw <-
pxweb_get(
url = "https://bank.stat.gl/api/v1/da/Greenland/SO/SO20/sox010.px",
query = list(
"no of children" = c("*"),
"no of adults" = c ("*"),
"municipality" = c("*"),
"unit" = c("Antal"),
"type" = c("10"),
"time" = c("*")
)) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transform
soD010 <-
soD010_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date())
# Plot
soD010_plot <-
soD010 %>%
filter(
`antal børn` != "I alt",
kommune == "I alt",
`antal voksne` != "I alt" &
`antal voksne` != "0 voksne"
) %>%
select(tid,
`antal børn`,
`antal voksne`,
`Offentlig hjælp, opgjort på familier`) %>%
mutate(`antal børn` = `antal børn` %>% fct_rev()) %>%
ggplot(aes(x = tid,
y = `Offentlig hjælp, opgjort på familier`,
fill = `antal børn`)) +
geom_col(position = "fill") +
facet_wrap( ~ `antal voksne`) +
scale_y_continuous(labels = scales::percent_format(scale = 100, accuracy = 1, big.mark = ".",
decimal.mark = ",")) +
theme_statgl() + scale_fill_statgl(reverse = TRUE, guide = guide_legend(reverse = TRUE)) +
labs(
title = "Offentlig hjælp efter familiestruktur",
subtitle = "Fordeling af offentlig hjælp i alt (et tidspunkt i løbet af året) efter antal børn og voksne i husstanden",
x = " ",
y = " ",
fill = " ",
caption = "Kilde: https://bank.stat.gl/soD010"
)
soD010_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
SODFPE1_raw <-
pxweb_get(
url = "https://bank.stat.gl/api/v1/da/Greenland/SO/SO50/SO5030/SOXFPE1.px",
query = list(
"age group" = c("*"),
"gender" = c("*"),
"unit" = c("*"),
"time" = c("*")
)) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transform
SODFPE1 <-
SODFPE1_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date())
# Plot
SODFPE1_plot <-
SODFPE1 %>%
filter(aldersgruppe == "I alt", køn == "I alt",
enhed == "% af aldersgruppe") %>%
ggplot(aes(x = tid,
y = `Førtidspensionister i december`,
fill = enhed)) +
geom_col() +
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 = "Førtidspensionister i alt",
subtitle = "Procent af aldersgruppe",
x = " ",
y = " ",
fill = "Mål",
caption = "Anm.:Optælling i december måned. \n Kilde: https://bank.stat.gl/SODFPE1"
)
SODFPE1_plot
# Loads
library("pxweb")
library("tidyverse")
library("statgl")
library("lubridate")
# Import
SODFPE1_2_raw <-
pxweb_get(
url = "https://bank.stat.gl/api/v1/da/Greenland/SO/SO50/SO5030/SOXFPE1.px",
query = list(
"age group" = c("*"),
"gender" = c("*"),
"unit" = c("*"),
"time" = c("*")
)) %>%
as.data.frame(column.name.type = "text", variable.value.type = "text") %>%
as_tibble()
# Transform
SODFPE1_2 <-
SODFPE1_2_raw %>%
mutate_if(is.factor, as.character) %>%
mutate(tid = as.numeric(tid) %>% make_date())
# Plot
SODFPE1_2_plot <-
SODFPE1_2 %>%
filter(aldersgruppe != "I alt" &
aldersgruppe != "65+",
køn == "I alt",
enhed == "% af aldersgruppe") %>%
ggplot(aes(x = tid,
y = `Førtidspensionister i december`,
fill = aldersgruppe)) +
geom_col() +
scale_y_continuous(labels = scales::percent_format(scale = 1, accuracy = 1, big.mark = ".",
decimal.mark = ",")) +
facet_wrap(~ aldersgruppe) +
theme_statgl() + scale_fill_statgl() +
labs(
title = "Førtidspensionister efter aldersgrupper",
subtitle = "Procent af aldersgruppe",
x = " ",
y = " ",
fill = " ",
caption = "Anm.:Optælling i december måned. \n Kilde: https://bank.stat.gl/SODFPE1"
)
SODFPE1_2_plot