in R I have a list of 100 phlyo objects called called Newick1
, Newick2
, Newick3
, etc. I want to do pairwise comparisons between the trees (e.g. all.equal.phylo(Newick1, Newick2)
) but am having difficulty figuring out how to do this efficiently since each file has a different name.
I think something like the for loop below will work, but how do I designate a different file for each iteration of the loop? For obvious reasons the [i] and [j] I put in the code below don't work, but I don't know what to replace them with.
Thank you very much!
for (i in 1:99) {
for (j in i+1:100) {
all.equal.phylo(Newick[i], Newick[j]) -> output[i,j]
} }