[R] recover log of matrix
arun
smartpink111 at yahoo.com
Mon May 13 22:07:37 CEST 2013
Hi,
mat1<- matrix(log(1:20),ncol=5)
exp(mat1)
# [,1] [,2] [,3] [,4] [,5]
#[1,] 1 5 9 13 17
#[2,] 2 6 10 14 18
#[3,] 3 7 11 15 19
#[4,] 4 8 12 16 20
mat2<- matrix(log2(1:20),ncol=5)
2^mat2
# [,1] [,2] [,3] [,4] [,5]
#[1,] 1 5 9 13 17
#[2,] 2 6 10 14 18
#[3,] 3 7 11 15 19
#[4,] 4 8 12 16 20
A.K.
----- Original Message -----
From: JiangZhengyu <zhyjiang2006 at hotmail.com>
To: "r-help at r-project.org" <r-help at r-project.org>
Cc:
Sent: Monday, May 13, 2013 2:41 PM
Subject: [R] recover log of matrix
Dear all, I have a matrix with all values being log transformed. I want them back to the values before the transformation. i.e. 2^matrix M. Is there any easy code to do this? Thanks,Zhengyu
[[alternative HTML version deleted]]
______________________________________________
R-help at 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.
More information about the R-help
mailing list