Re: [R] Triangular matrix upper to down

2011-09-26 Thread m.marcinmichal
Ok, thanks this solution test[lower.tri(test)] <- t(test)[lower.tri(test)] works perfectly well :) Thanks Best marcin M. -- View this message in context: http://r.789695.n4.nabble.com/Triangular-matrix-upper-to-down-tp3845107p3845352.html Sent from the R help mailing list archive at Nabble

Re: [R] Triangular matrix upper to down

2011-09-26 Thread m.marcinmichal
Mhy, I think that this solution It doesn't work with odd dimension. Suppose we have a reference matrix 13x13 (near i present a table format i.e save by write.table). This matrix name a response2. "V1" "V2" "V3" "V4" "V5" "V6" "V7" "V8" "V9" "V10" "V11" "V12" "V13" "1" 0 1.4142135623731 1 1.732050

Re: [R] Triangular matrix upper to down

2011-09-26 Thread William Dunlap
.com] Sent: Monday, September 26, 2011 1:30 PM To: William Dunlap; r-help; m.marcinmichal Subject: Re: [R] Triangular matrix upper to down Nope, I was sloppy and missed that. Thanks ... forwarding to list and OP Michael On Mon, Sep 26, 2011 at 4:26 PM, William Dunlap mailto:wdun...@tibco.com>&g

Re: [R] Triangular matrix upper to down

2011-09-26 Thread R. Michael Weylandt
Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of R. Michael > > Weylandt > > Sent: Monday, September 26, 2011 1:10 PM > > To: m.ma

Re: [R] Triangular matrix upper to down

2011-09-26 Thread R. Michael Weylandt
On Mon, Sep 26, 2011 at 4:09 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > How about: test[lower.tri(test)] <- test[upper.tri(test)] > > Try it with this data so you can see that it actually works: (the ones > obscure possible false solutions) > > > test <- matrix(ncol = 4, nrow =

[R] Triangular matrix upper to down

2011-09-26 Thread m.marcinmichal
Hi, suppose that we have a triangular upper matrix A test <- matrix(ncol = 4, nrow = 4) test[1, ] <- c(NA,1,1,1) test[2, ] <- c(NA,NA,1,1) test[3, ] <- c(NA,NA,NA,1) test[4, ] <- c(NA,NA,NA,NA) I know how quickly set diagonal value diag(test) <- 1. But how quickly set down value i.e. matrix i