Closed eliotmcintire closed 8 years ago
Yes, thanks! It was a problem when there were duplicates among the agents
.
I fixed both parts:
the for-loop needed a unique()
to not duplicate the neighbors in the list item for each duplicate,
and I added an "id" in the vectorized part to have length(listAgents) == length(cellNum)
The part in the loop returns a list of length cellNum. The part in the vectorized code returns a list of length = length(unique(neighbors_df[,1])) ...
These should be the same, I suspect.