I want to do a for loop with lists.
I tried :
for(tri in tripletsFinaux){
CoefsCrit = apprentissage(data,tri$concurrents,tri$client,tri$depot)
/* I put actions here but you don't need to see it for my problem */
}
In my loop, I launch a function which need the different values of the list tri. Because tripletsFinaux is a dataframe. And I need the 3 values of each tri to perform my function apprentissage() in the for loop.
tripletsFinaux looks like :
head(tripletsFinaux,2)
depot client concurrents nbLignes
1 blablabla blobloblo tatata 131
2 bliblibli blublbublu tututu 231
My error is :
$ operator is invalid for atomic vectors
What can I do ? I don't know if the error is in the apprentissage() function or in the for loop