Commit 2348a097 authored by Simon, Wolfram's avatar Simon, Wolfram
Browse files

small changes model data R script

parent 08fac85c
......@@ -2040,8 +2040,25 @@ miss = vec_missing %>% as_tibble() %>% rename(Product = value)
AnimSheetDemi_comp = AnimSheetDemi2 %>% bind_rows(miss)
# Are the values distinct?
AnimSheetDemi_comp #315 rows
AnimSheetDemi_comp %>% distinct(Product) #315
write_csv(AnimSheetDemi_comp, "AnimSheetDemi_adj.csv")
# Manually added the missing content to the animal sheet
AnimSheetDemi = read_excel("D:/GAMS/EU_model_Feb2022/European_CiFoS_model_data.xlsx", sheet = "AnimSheetDemi") %>%
select(-c( CFATh...63 ,NFEh...64)) %>%
relocate(K, .before = "VEM") %>% type.convert()
Processing = read_excel("D:/GAMS/EU_model_Feb2022/European_CiFoS_model_data.xlsx", sheet = "Processing_Fraction")
# Are all Products in the processing sheet also in the animal nutrition sheet
# vec_too_much = AnimSheetDemi$Product[!AnimSheetDemi$Product %in% c(Processing$proc_out, Processing$proc_raw)]
# AnimSheetDemi2 = AnimSheetDemi %>% filter(!Product %in% vec_too_much) #%>% write_csv("Input_data/animalsheet_demi2.csv")
AnimSheetDemi2$Product[!AnimSheetDemi2$Product %in% c(Processing$proc_out, Processing$proc_raw)]
# character(0)
# pasting the name from the old dataframe to the new one
setNames(AnimSheetDemi2, names(Animal_Feed_Nutr_old)) %>% write_csv("Input_data/animalsheet_demi3.csv")
# Loss fraction sheet ----------------------------------------------------
......
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