May I ask you how can I compare a table (which has these attributes: initial machine name, destination machine name and incremental numeric ID) and an empty array (which has as attributes: arrival machine name in the columns and the target machine name start in lines).
If there is this correspondence between the departure and the arrival, then I have to fill with the incremental id value inside the array.
for (i in nrow(rownames(tabellaMatrice))) {
  for (j in ncol(colnames(tabellaMatrice))) {
    for (r in nrow(tab2$Da)) {
      ifelse(tab2$Da[r]==rownames(tabellaMatrice)[i],
             for (o in nrow(tab2$A)) {
               ifelse(tab2$A[o]==colnames(tabellaMatrice),
                      for (p in nrow(tab2$`Numero incrementale`)) {
                        tabellaMatrice[i,j]<-tab2$`Numero incrementale`[p]
                        
                      }
                      ,"")
               
             },"")
      
    }
    
  }
  
}
I'm trying to do this with for loops
I expect that inside the array is incremental id.
