Hi Moohwan, On Dec 11, 2009, at 11:26 AM, Moohwan Kim wrote:
> Dear R family > > I have a following question. > Suppose I have a matrix as follows, for instance: > tau= > 0 0 0 0 1 > 1 0 0 0 0 > 0 1 0 0 0 > 0 0 1 0 0 > 0 0 0 1 0 > > I want to have the inverse of the above matrix and then add some > exponent to it. That is, I want to calculate tau to the (-m). For > example, m=893. If you *really* want the inverse, use the `solve` function without a second parameter: R> tau <- c(0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0) R> tau <- matrix(tau, ncol=5, byrow=TRUE) R> tau %*% solve(tau) [,1] [,2] [,3] [,4] [,5] [1,] 1 0 0 0 0 [2,] 0 1 0 0 0 [3,] 0 0 1 0 0 [4,] 0 0 0 1 0 [5,] 0 0 0 0 1 -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact ______________________________________________ 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.