第8週

02/08(TH) 紛争と貧困の連鎖1

            紛争と貧困の連鎖2

第8週と第9週では、戦争、気候変動、COVID-19の複合的要因が世界的な食糧危機を引き起こし、格差と貧困を加速させている現状について、議論します。

02/13(TU) Rでデータサイエンス8:難民、軍事支出  [Main]・[授業]

Global Link-Refugees

Refugee population by country or territory of asylum:SM.POP.REFG [Link]

Refugee population by country or territory of origin:SM.POP.REFG.OR [Link]

Net ODA received (% of GNI):DT.ODA.ODAT.GN.ZS [Link]

Net official development assistance and official aid received (current US$):DT.ODA.ALLD.CD [Link]

Net ODA received (% of central government expense):DT.ODA.ODAT.XP.ZS [Link]

Military expenditure (current USD):MS.MIL.XPND.CD [Link]

Military expenditure (% of general government expenditure):MS.MIL.XPND.ZS [Link]

Arms imports (SIPRI trend indicator values):MS.MIL.MPRT.KD [Link]

Arms exports (SIPRI trend indicator values):MS.MIL.XPRT.KD [Link]

内容

df_peace <- WDI(
  indicator = c(refugee_asylum = "SM.POP.REFG",
                refugee_origin = "SM.POP.REFG.OR",
                oda_gni = "DT.ODA.ODAT.GN.ZS",
                oda_usd = "DT.ODA.ALLD.CD",
                oda_gov = "DT.ODA.ODAT.XP.ZS",
                military_usd = "MS.MIL.XPND.CD",
                military_gov = "MS.MIL.XPND.ZS",
                arms_imports = "MS.MIL.MPRT.KD",
                arms_exports = "MS.MIL.XPRT.KD"), extra = TRUE)
write_csv(df_peace, "data/peace.csv")
df_peace <- read_csv("data/peace.csv")
Rows: 16758 Columns: 21── Column specification ─────────────────────────────────────────────────
Delimiter: ","
chr   (7): country, iso2c, iso3c, region, capital, income, lending
dbl  (12): year, refugee_asylum, refugee_origin, oda_gni, oda_usd, od...
lgl   (1): status
date  (1): lastupdated
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df_peace_long <- df_peace |> 
  pivot_longer(7:15, names_to = "name", values_to = "value")
df_peace_long |> 
  group_by(year, name) |> drop_na(value) |>
  summarize(num = n()) |> arrange(desc(year))
`summarise()` has grouped output by 'year'. You can override using the `.groups` argument.
df_peace_long |> 
  group_by(year, name) |> drop_na(value) |>
  summarize(num = n()) |> 
  ggplot(aes(year, num, col = name)) + geom_line() +
  labs(title = "各指標の年毎のデータ数", y = "データ数", x = "年")
`summarise()` has grouped output by 'year'. You can override using the `.groups` argument.

World Development Indicators: [Link]

df_peace_long |> 
  filter(name %in% c("military_gov", "oda_gni", "oda_gov")) |>
  filter(iso2c %in% c("1W", "ZF")) |> drop_na(value) |>
  ggplot(aes(year, value, col = name, linetype = iso2c)) + geom_line()

LS0tCnRpdGxlOiAiR0VTIDAwMSDmvJTnv5I4IgphdXRob3I6ICJILiBTdXp1a2kiCmRhdGU6ICJgciBTeXMuRGF0ZSgpYCIKb3V0cHV0OgogIGh0bWxfbm90ZWJvb2s6IGRlZmF1bHQKLS0tCgojIyDnrKw46YCxCgowMi8wOChUSCnjgIDntJvkuonjgajosqflm7Djga7pgKPpjpYxCgrCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIOe0m+S6ieOBqOiyp+WbsOOBrumAo+mOljIKCuesrDjpgLHjgajnrKw56YCx44Gn44Gv44CB5oim5LqJ44CB5rCX5YCZ5aSJ5YuV44CBQ09WSUQtMTnjga7opIflkIjnmoTopoHlm6DjgYzkuJbnlYznmoTjgarpo5/ns6fljbHmqZ/jgpLlvJXjgY3otbfjgZPjgZfjgIHmoLzlt67jgajosqflm7DjgpLliqDpgJ/jgZXjgZvjgabjgYTjgovnj77nirbjgavjgaTjgYTjgabjgIHorbDoq5bjgZfjgb7jgZnjgIIKCjAyLzEzKFRVKeOAgFLjgafjg4fjg7zjgr/jgrXjgqTjgqjjg7Pjgrk477ya6Zuj5rCR44CB6LuN5LqL5pSv5Ye644CAIFtbTWFpbl0oaHR0cHM6Ly9kcy1zbC5naXRodWIuaW8vaW50cm8yci9nZXMwMDEvZ2VzMDAxLW1haW4ubmIuaHRtbCld44O7W+aOiOalrV0KCioqR2xvYmFsIExpbmstUmVm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