Hello R experts,
  I am trying to do adonis (vegan package) on multiple files using loop.
But I am having hard time in this.
Here is what I tried.

setwd("PATH")
files <- list.files(pattern = "[.]txt$")
ldf <- lapply(files, read.table, row.names=1)
str(ldf)
res <- lapply(ldf, summary)
 for (i in length(res))
{Addon[[i]]<-adonis(vegdist(t(ldf[[i]]))~Factor)
}
print(i)

But obviously this is not working.
Until the list it works fine. Also if I test with
print(adonis(vegdist(t(ldf[[1]]))~Factor)), this also provised correct
result.
But specifying the Addon[[i]], is something wrong. Please help,
Thanks a lot,
Mitra

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to