Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simon, Wolfram
CiFoS_Crops
Commits
2348a097
Commit
2348a097
authored
Mar 17, 2022
by
Simon, Wolfram
Browse files
small changes model data R script
parent
08fac85c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Input_data/Copy of European_CiFoS_model_data_ANITANov21.xlsx
View file @
2348a097
No preview for this file type
R_to_SQL_database/Cifos_Model_Data_EU.R
View file @
2348a097
...
...
@@ -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 ----------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment