I need to loop over files and then create for each file an object:
Here is an example :
filenames <- Sys.glob("/Users/Desktop/*.nwk")
for (i in filenames ) {
print(paste0("Processing the phylogeny: ",i))
p <- a code that generate a figure
}
And then I generate 5 figures that I call with this code :
multiplot(p1,p2,p3,p4,p5 ncol=2, labels=c('A', 'B','C','D','E'))
But I wondered how can I call assign the 1,2 etc values into the variable objects p?
I tried to create a nb=1 object and then assign as p+nb <- a code that generate a figure, but it does not work