These are all `methods' of generic functions which are here applied to
DNA sequences stored as objects of class "DNAbin"
. They are
used in the same way than the standard R functions to manipulate
vectors, matrices, and lists. Additionally, the operators [[
and $
may be used to extract a vector from a list. Note that
the default of drop
is not the same than the generic operator:
this is to avoid dropping rownames when selecting a single sequence.
These functions are provided to manipulate easily DNA sequences coded
with the bit-level coding scheme. The latter allows much faster
comparisons of sequences, as well as storing them in less memory
compared to the format used before ape 1.10.
For cbind
, the default behaviour is to keep only individuals
(as indicated by the rownames) for which there are no missing data. If
fill.with.gaps = TRUE
, a `complete' matrix is returned,
enventually with insertion gaps as missing data. If check.names
= TRUE
(the default), the rownames of each matrix are checked, and
the rows are reordered if necessary (if some rownames are duplicated,
an error is returned). If check.names = FALSE
, the matrices
must all have the same number of rows, and are simply binded; the
rownames of the first matrix are used. See the examples.
as.matrix
may be used to convert DNA sequences (of the same
length) stored in a list into a matrix while keeping the names and the
class. as.list
does the reverse operation.