I\'m working with R and I have a code like this:
R
for (i in 1:10) for (j in 1:100) if (data[i] == paths[j,1]) cluster[i,4] <
I think that both loops can be vectorized using the following:
cluster[na.omit(match(paths[1:100,1],data[1:10])),4] = paths[!is.na(match(paths[1:100,1],data[1:10])),2]