Re: [R-sig-phylo] Iterating though multiple FASTA files via rbind.DNAbin

2020-03-12 Thread Emmanuel Paradis
Hi Jarrett, read.FASTA() always returns a list. So you may do something (quite general) like: fls <- dir(pattern = "\\.fas$|\\.fasta$", ignore.case = TRUE) # add more file extensions if needed X <- lapply(fls, read.FASTA) seqlen <- lengths(X) if (length(unique(seqlen)) == 1) X <- as.matrix(X)

Re: [R-sig-phylo] Iterating though multiple FASTA files via rbind.DNAbin

2020-03-12 Thread BRET R LARGET
It will be more efficient if you pre-specify the length of the list, I understand. Depending on the size of the data, this may or may not be important. I have not tested this code either. seqs <- vector(mode = "list", length = DESIRED_LENGTH) ## replace DESIRED_LENGTH with the appropriate

[R-sig-phylo] How to create LTT plots in R

2020-03-12 Thread Ni Ni Win
Dear Sir/Madam, My name is Ni Ni Win and I am studying marine algae. I am trying to create LTT plots using phytools in R but I am just a beginner in using R and I even don't know how to start R for LTT plots too. After studying about the LTT plots via the internet and reading the books (Analysis

[R-sig-phylo] Iterating though multiple FASTA files via rbind.DNAbin

2020-03-12 Thread Jarrett Phillips
Hi All, I have a folder with multiple FASTA files which need to be read into R. To avoid file overwriting, I use ape::rbind.DNAbin() as follows: file.names <- list.files(path = envr$filepath, pattern = ".fas") tmp <- matrix() for (i in 1:length(file.names)) {