Commit bc321bd2 authored by Wacker, Jan-David's avatar Wacker, Jan-David
Browse files

sdsdz

parent 613c892c
......@@ -3042,17 +3042,24 @@ write_csv(animal_map, "Input_Data/diets_animal_crop_datamap.csv")
# Distance matrix ---------------------------------------------------------
# Data is taken from here: https://github.com/mlschneid/country-distance/blob/master/output/distance-matrix.csv
dat_distance = read_csv("Input_data/Distance_matrix.csv") %>%
rename("CountryA" = "...1")
dat_distance = read_csv("Input_data/Distance_matrix.csv") # %>%
# rename("CountryA" = "...1")
# Country map for subsetting EU
country_map_FAO_iso2 = read.csv(here::here("Input_data", "Mappings", "dat_map_SPAM_GAUL_CIFOS_FAO.csv")) %>%
as_tibble() %>% dplyr::select(iso3_SPAM , iso2_code_FAO, name_cntr_CIFOS2021)
country_map_FAO_iso2 = read.csv("Input_data/Mappings/dat_map_SPAM_GAUL_CIFOS_FAO.csv") %>% drop_na() %>%
as_tibble() %>% dplyr::select(iso3_SPAM , iso2_code_FAO, name_cntr_CIFOS2021) %>%
mutate(iso3_SPAM= as.character(iso3_SPAM)) %>%
add_column(a=numeric(nrow(country_map_FAO_iso2)))
# EU28 - Subsetting -------------------------------------------------------
EU_iso3 = c("AUT","BEL", "BGR", "HRV", "CZE", "DNK", "EST","FIN", "FRA", "DEU", "GRC", "HUN", "IRL", "ITA","LVA",
"LTU", "LUX", "MLT", "NLD", "POL", "PRT","ROU", "SVK","SVN", "ESP", "SWE", "GBR", "CYP")
for (i in 1:nrow(country_map_FAO_iso2)){
if (country_map_FAO_iso2[i,"iso3_SPAM"] %in% EU_iso3){
country_map_FAO_iso2[i,"a"]=1
}
}
dat_distance %>% pivot_longer()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment