X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=man%2FDNAbin.Rd;h=b08446f6005a67dae11e2b9503a3f76bb14112e7;hb=5de3d16fdc60bcbab2ae04933bca4ab931ed48f8;hp=94593727bae759bc817b340ca29a4f501939ccbb;hpb=58c10f2bc11baf46563dc5541181bb97d0956ecb;p=ape.git diff --git a/man/DNAbin.Rd b/man/DNAbin.Rd index 9459372..b08446f 100644 --- a/man/DNAbin.Rd +++ b/man/DNAbin.Rd @@ -6,6 +6,7 @@ \alias{rbind.DNAbin} \alias{cbind.DNAbin} \alias{as.matrix.DNAbin} +\alias{c.DNAbin} \title{Manipulate DNA Sequences in Bit-Level Format} \description{ These functions help to manipulate DNA sequences coded in the @@ -15,25 +16,34 @@ \method{print}{DNAbin}(x, \dots) \method{summary}{DNAbin}(object, printlen = 6, digits = 3, \dots) \method{rbind}{DNAbin}(\dots) -\method{cbind}{DNAbin}(\dots, check.names = TRUE) +\method{cbind}{DNAbin}(\dots, check.names = TRUE, fill.with.gaps = FALSE, + quiet = FALSE) \method{[}{DNAbin}(x, i, j, drop = TRUE) \method{as.matrix}{DNAbin}(x, \dots) +\method{c}{DNAbin}(\dots, recursive = FALSE) } \arguments{ \item{x, object}{an object of class \code{"DNAbin"}.} \item{\dots}{either further arguments to be passed to or from other methods in the case of \code{print}, \code{summary}, and \code{as.matrix}, or a series of objects of class \code{"DNAbin"} in - the case of \code{rbind} and \code{cbind}.} + the case of \code{rbind}, \code{cbind}, and \code{c}.} \item{printlen}{the number of labels to print (6 by default).} \item{digits}{the number of digits to print (3 by default).} \item{check.names}{a logical specifying whether to check the rownames before binding the columns (see details).} + \item{fill.with.gaps}{a logical indicating whether to keep all + possible individuals as indicating by the rownames, and eventually + filling the missing data with insertion gaps (ignored if + \code{check.names = FALSE}).} + \item{quiet}{a logical to switch off warning messages when some rows + are dropped.} \item{i, j}{indices of the rows and/or columns to select or to drop. They may be numeric, logical, or character (in the same way than for standard R objects).} \item{drop}{logical; if \code{TRUE} (the default), the returned object is of the lowest possible dimension.} + \item{recursive}{for compatibility with the generic (unused).} } \details{ These are all `methods' of generic functions which are here applied to @@ -47,11 +57,14 @@ comparisons of sequences, as well as storing them in less memory compared to the format used before \pkg{ape} 1.10. - For \code{cbind}, if \code{"check.names = TRUE"}, the rownames of each - matrix are checked, and the rows are reordered if necessary. If the - rownames differ among matrices, an error occurs. If - \code{"check.names = FALSE"}, the matrices are simply binded and the - rownames of the first matrix are used. + For \code{cbind}, the default behaviour is to keep only individuals + (as indicated by the rownames) for which there are no missing data. If + \code{fill.with.gaps = TRUE}, a `complete' matrix is returned, + enventually with insertion gaps as missing data. If \code{check.names + = TRUE} (the default), the rownames of each matrix are checked, and + the rows are reordered if necessary. If \code{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. \code{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 @@ -63,7 +76,7 @@ } \references{ Paradis, E. (2007) A Bit-Level Coding Scheme for Nucleotides. - \url{http://pbil.univ-lyon1.fr/R/ape/misc/BitLevelCodingScheme_20April2007.pdf} + \url{http://ape.mpl.ird.fr/misc/BitLevelCodingScheme_20April2007.pdf} } \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}} \seealso{ @@ -82,5 +95,13 @@ summary(woodmouse[1:5, 1:300], 15, 6) ### Just to show how distances could be influenced by sampling: dist.dna(woodmouse[1:2, ]) dist.dna(woodmouse[1:3, ]) +### cbind and its options: +x <- woodmouse[1:2, 1:5] +y <- woodmouse[2:4, 6:10] +as.character(cbind(x, y)) # gives warning +as.character(cbind(x, y, fill.with.gaps = TRUE)) +\dontrun{ +as.character(cbind(x, y, check.names = FALSE)) # gives an error +} } \keyword{manip}