Preparing final area crop dataset for Validation
dat.SPAM.EU = dat_spam_global %>% #Pixel level data
filter(iso3 %in% EU_iso3) %>%
group_by(iso3, crop) %>%
summarise(sum(H), sum(A)) %>%
left_join(., dat_country, by = "iso3") %>%
dplyr::select(iso3, crop, `sum(H)`, `sum(A)`) %>%
rename(HarvestedArea_ha = `sum(H)`,
PhysicalArea_ha = `sum(A)`) #%>%
left_join(., dat_country, by = "crop") #%>%
dplyr::select(iso3, Country, crop_SPAM, `sum(H)`, `sum(A)`, crop_SPAM_long, FAO_no, crop_FAO) %>%
Thhis code is not fully working. I want to sum H and A by croop and country. Doesn't work. Must be a typosomewhgere...