I have data with a number of test. In fonction of the data, number of test can be different and I want to automate my code as much as I can. I have some steps of importations or things like that for example, and I don't know how to do to do it in fonction of my number of tests.
memo <-paste(BITR$num_ref,BITR$prenom,BITR$nom,BITR$njf,BITR$cp,BITR$ddn,BITR$sexe,
BITR$adresse1,BITR$adresse2,BITR$localite,
BITR$date_test_1,BITR$type_test_1, BITR$resultat_1, BITR$resul_test_1, BITR$date_1, BITR$resul_1,
BITR$date_test_2,BITR$type_test_2, BITR$resultat_2, BITR$resul_test_2, BITR$date_2, BITR$resul_2,
BITR$date_test_3,BITR$type_test_3, BITR$resultat_3, BITR$resul_test_3, BITR$date_3, BITR$resul_3,
BITR$date_test_4,BITR$type_test_4, BITR$resultat_4, BITR$resul_test_4, BITR$date_4, BITR$resul_4,
BITR$date_test_5,BITR$type_test_5, BITR$resultat_5, BITR$resul_test_5, BITR$date_5, BITR$resul_5,
BITR$date_test_6,BITR$type_test_6, BITR$resultat_6, BITR$resul_test_6, BITR$date_6, BITR$resul_6,
BITR$date_test_7,BITR$type_test_7, BITR$resultat_7, BITR$resul_test_7, BITR$date_7, BITR$resul_7,
sep="_")
data<- data.frame(id, prenom, nom, nomjf, ddn, sexe,cpNaiss,cp,ville,
date_testD1,type_testD1,resultatD1,result_testD1,date_D1,resul_D1,
date_testD2,type_testD2,resultatD2,result_testD2,date_D2,resul_D2,
date_testD3,type_testD3,resultatD3,result_testD3,date_D3,resul_D3,
date_testD4,type_testD4,resultatD4,result_testD4,date_D4,resul_D4,
date_testD5,type_testD5,resultatD5,result_testD5,date_D5,resul_D5,
date_testD6,type_testD6,resultatD6,result_testD6,date_D6,resul_D6,
date_testD7,type_testD7,resultatD7,result_testD7,date_D7,resul_D7,Class)
These are examples of my instructions, and I want my program to do it easily, without the user need for example to add lines in the code. For example with "start_with ='date_testD'" or I don't know how.
Thank you for your time