sknqualitasag / qp4ewc

Other
0 stars 2 forks source link

Error in file.copy(list_of_files, s_scenario) : more 'from' files than 'to' files #4

Closed pvrqualitasag closed 2 years ago

pvrqualitasag commented 2 years ago

When running the command given in 'Manual.Rmd', the following error appears

`# Sire breed can be: AN,AU,CH,LM,OB,SI corresponding to Angus,Aubrac, Charolais, Limousin, Original-Braunvieh, Simmental s_sirebreed <- "LM"

Production system according to ECOWEIGHT: 1,2,3,4 corresponding to purebreeding, crossbreeding, terminal crossing, dairy

s_prodsystew <- "2"

Marketing channel can be: Natura-Beef, SwissPrimBeef

s_marketingchannel <- "Natura-Beef"

Path to define from the working directory

s_path_directory2create <- file.path(tempdir(),"qw4ewc","work")

Path to input from the literature research. Based on this example an other file can be created with different input-value and input-source.

s_input_file_literature <- system.file("extdata","ewbc","input_literature.txt", package = "qp4ewc")

Path to input from the parameter specific for the scenario. Based on this example an other file can be created with different input-value.

s_input_file_par <- system.file("extdata","ewbc","input_par_statement.txt", package = "qp4ewc")

Path to input from the calving. Based on this example an other file can be created with different input-values.

s_input_file_calving_statement <- system.file("extdata","ewbc","input_calving_statement.txt", package = "qp4ewc")

Path to calving data file

s_input_file_calving <- system.file("extdata","ewbc","test","test_zws_muku_gal.csv", package = "qp4ewc")

Date YYYYMMDD used as start date to filter data for calving or carcass

s_start_date <- 20160101

Date YYYYMMDD used as end date to filter data for calving or carcass

s_end_date <- 20211231

Path to input from the progeny flp data. Based on this example an other file can be created with different input-values.

s_input_file_progeny_flp_statement <- system.file("extdata","ewbc","input_flp_statement.txt", package = "qp4ewc")

Path to flp data file

s_input_file_flp <- system.file("extdata","ewbc","test","test_zws_muku_flp.csv", package = "qp4ewc")

Path to input statement for carcass and price

s_input_file_flp_carcass_matrix_statement <- system.file("extdata","ewbc","input_flp_carcass_matrix_statement.txt", package = "qp4ewc")

Path to input with cow price. Based on this example an other file can be created with different input-values.

s_input_file_price_cow <- system.file("extdata","ewbc","cow_price.txt", package = "qp4ewc")

Path to input with bull price. Based on this example an other file can be created with different input-values.

s_input_file_price_bull <- system.file("extdata","ewbc","bull_price.txt", package = "qp4ewc")

Path to input with heifer price. Based on this example an other file can be created with different input-values.

s_input_file_price_heifer <- system.file("extdata","ewbc","heifer_price.txt", package = "qp4ewc")

Flag to set to TRUE, if a log-file is whished

b_log <- TRUE

qp4ewc::pre_process_ewbc_input(ps_sirebreed = s_sirebreed, ps_prodsystew = s_prodsystew, ps_marketchannel = s_marketingchannel, ps_path_directory2create = s_path_directory2create, ps_input_file_literature = s_input_file_literature, ps_input_file_par = s_input_file_par, ps_input_file_calving_statement = s_input_file_calving_statement, ps_input_file_calving = s_input_file_calving, ps_start_date = s_start_date, ps_end_date = s_end_date, ps_input_file_progeny_flp_statement = s_input_file_progeny_flp_statement, ps_input_file_flp = s_input_file_flp, ps_input_file_flp_carcass_matrix_statement = s_input_file_flp_carcass_matrix_statement, ps_input_file_price_cow = s_input_file_price_cow, ps_input_file_price_bull = s_input_file_price_bull, ps_input_file_price_heifer = s_input_file_price_heifer, pb_log = b_log) `

Error in file.copy(list_of_files, s_scenario) : more 'from' files than 'to' files

pvrqualitasag commented 2 years ago

Solved by making directory creation recursive. Fixed with version 0.1.4