as.numeric-methods | R Documentation |
Dna
object to a numeric matrixConverts a character matrix to a numeric matrix.
## S4 method for signature 'Dna'
as.numeric(x)
x |
an object of class |
Function as.numeric()
coerces the character matrix in the slot sequence
to a numeric matrix.
Lower or upper case characters "?","A","C","G","T","-" are converted to integers 0,1,2,3,4,5, respectively.
returns a numeric matrix.
signature(x = "Dna")
coerces a Dna object to a numeric matrix.
x<-matrix(c("?","A","C","g","t","-","0","1","2","3","4","5"),4,6)
rownames(x)<-c("seq1","seq2","seq3","seq4")
x<-as.dna(x)
# original character matrix
as.matrix(x)
## Coercing a 'Dna' object to a numeric matrix.
# numeric matrix
as.numeric(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.