Commit 563f80b1 authored by Simon, Wolfram's avatar Simon, Wolfram
Browse files

visualization functions for comparing the deviation of our extracted area data...

visualization functions for comparing the deviation of our extracted area data with FAOSTAT and EUROSTAT is fiished and works (look for ggarrange function in script)
parent 098d2613
......@@ -372,8 +372,8 @@ Fun_ggplot_area_deviation = function(dat,lut_vec,author_vec,vec_source){
}
# Plotting - leandro extraction
Fun_ggplot_area_deviation(arable_area_cifos, lut_vec="arable", author_vec = "WJS", vec_source = "EUROSTAT")
Fun_ggplot_area_deviation(grass_area_cifos,lut_vec="grass", author_vec = "WJS" , vec_source = "EUROSTAT")
gg_leandro_eurostat_arable=Fun_ggplot_area_deviation(arable_area_cifos, lut_vec="arable", author_vec = "Leandro", vec_source = "EUROSTAT")
gg_leandro_eurostat_grass=Fun_ggplot_area_deviation(grass_area_cifos,lut_vec="grass", author_vec = "Leandro" , vec_source = "EUROSTAT")
# Comparing the own extraction from R script 'Zones_AEZ.R' -----------------
Fun_area_join_WJSextract = function(dat,vec_lut){
......@@ -403,29 +403,44 @@ arable_area_cifos_WJex = Fun_area_join_WJSextract(dat = permanent_area %>% bind
vec_lut = c("arable"))
# Plotting - WJS extraction
Fun_ggplot_area_deviation(grass_area_cifos_WJex, lut_vec="arable", author_vec = "WJS",vec_source = "EUROSTAT")
Fun_ggplot_area_deviation(arable_area_cifos_WJex,lut_vec="grass", author_vec = "WJS", vec_source = "EUROSTAT")
gg_WJS_eurostat_arable=Fun_ggplot_area_deviation(grass_area_cifos_WJex, lut_vec="arable", author_vec = "WJS",vec_source = "EUROSTAT")
gg_WJS_eurostat_grass=Fun_ggplot_area_deviation(arable_area_cifos_WJex,lut_vec="grass", author_vec = "WJS", vec_source = "EUROSTAT")
# comparing with FAO area ---------------------------------------------------------------------
EU_cntr_Cifos = c("Austria","Belgium","Bulgaria","Croatia","Cyprus", "Czechia","Denmark",
"Estonia","Finland","France","Germany","Greece","Hungary","Ireland",
"Italy","Latvia","Lithuania","Luxembourg","Malta","Netherlands","Poland",
"Portugal","Romania","Slovakia","Slovenia","Spain","Sweden",'United Kingdom')
fao_arable_area =
read_csv("INput_data/area_harvested_FAO_arablecrops.csv") %>%
clean_names() %>% type.convert() %>%
left_join(country_map, by = c("area_code_fao" = "ADM0_CODE_GAUL")) #%>%
filter(., iso3_SPAM %in% EU_iso3) %>%
rename("country" = "name_cntr_CIFOS2021",
clean_names() %>% type.convert() %>%
mutate(area = recode(area, "United Kingdom of Great Britain and Northern Ireland"= "United Kingdom")) %>%
filter(., area %in% EU_cntr_Cifos) %>%
rename("country" = "area",
"area_ha"="value") %>%
group_by(year_code, country) %>%
summarise(area_ha = mean(area_ha,na.rm=T)) %>%
ungroup() %>%
group_by(country) %>%
summarise(area_ha = sum(area_ha,na.rm=T))
grass_area_cifos_WJex_fao = Fun_area_join_WJSextract(dat = fao_arable_area, vec_lut = c("arable"))
# Applying the function with FAO arable area data to the extracted datasets of Leandro and Wolfram
arable_area_cifos_WJex_fao = Fun_area_join_WJSextract(dat = fao_arable_area, vec_lut = c("arable"))
arable_area_cifos_fao = Fun_area_join(dat = fao_arable_area, vec_lut = c("arable"))
# Plotting the two extraction types from Leandro and Wolfram
gg_WJS_fao_arable = Fun_ggplot_area_deviation(arable_area_cifos_WJex_fao, lut_vec="arable", author_vec = "WJS",vec_source = "FAOSTAT - 10 year average")
gg_leandro_fao_arable = Fun_ggplot_area_deviation(arable_area_cifos_fao, lut_vec="arable", author_vec = "Leandro",vec_source = "FAOSTAT - 10 year average")
# Conclusion: Leandros extraction is way to low (average around -60% of the FAOSTAT reference)
# Arable land
ggarrange(gg_leandro_eurostat_arable, gg_leandro_fao_arable,
gg_WJS_eurostat_arable, gg_WJS_fao_arable)
Comb_Zon_EU28 %>%
left_join(fao_arable_area, by=c("country_cifos"="country")) %>%
mutate(diff_perc = 100-(100/area_ha*area_ha_cifos))
# Grass area
ggarrange(gg_leandro_eurostat_grass, gg_WJS_eurostat_grass, nrow = 2)
# EU28 - Subsetting -------------------------------------------------------
EU_iso3 = c("AUT","BEL", "BGR", "HRV", "CZE", "DNK", "EST","FIN", "FRA", "DEU", "GRC", "HUN", "IRL", "ITA","LVA",
......
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