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)
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
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
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)) {