On Nov 10, 2007 2:25 PM, affy snp <[EMAIL PROTECTED]> wrote:
> I am wondering how to log-2 based transform a matrix with numeric values?
> I tried > CGHlog2<-log2(CGH) but got an error. Then I found for log2(x) in R,
> the x has to be a numeric or complex vector. Any method for a matrix?

One can use log2 with matrices:

> m <- matrix(1:9,3)
> m
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9
> log2(m)
         [,1]     [,2]     [,3]
[1,] 0.000000 2.000000 2.807355
[2,] 1.000000 2.321928 3.000000
[3,] 1.584963 2.584963 3.169925
>

Paul

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to