[R] triangular matrix

ben@zoo.ufl.edu ben at zoo.ufl.edu
Wed Nov 1 17:47:25 CET 2000


  Here's a way:

tmpmat <- function(a,n) {
  x <- matrix(a,nrow=n,ncol=n)
  x <- x^pmax(0,row(x)-col(x))
  x[row(x)<col(x)] <- 0
  x
}


-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list