matrix.to.aln {ComPairWise} | R Documentation |
This is the inverse of aln.to.matrix
. It reads a character matrix and turns it into an alignment object.
matrix.to.aln(matrix)
matrix |
A matrix of aligned data, usually but not necessarily DNA. If taxon names are the row names of the matrix, they will be preserved. If the matrix has no row names, the output taxon names will be NULL. |
~Describe the value returned An alignment object, whose elements are
nb |
Number of aligned sequences |
nam |
Character vector of the names of the sequences (NULL if none included in the input matrix) |
seq |
Character vector of the sequences |
com |
currently always NA; could be a comment |
TER
## The function is currently defined as function (matrix) { x <- unname(apply(matrix, 1, paste, collapse = "")) aln <- list(nb = nrow(matrix), nam = rownames(matrix), seq = x, com = NA) class(aln) <- "alignment" return(aln) }