On Tue, Jul 14, 2009 at 1:56 PM, David Winsemius<dwinsem...@comcast.net> wrote:

>> temp[ upper.tri(temp) ]
>  [1]  7 13 14 19 20 21 25 26 27 28 31 32 33 34 35

Thanks! I didn't know about that function; it certainly makes things a
lot easier. For example, until now I have used the following, homemade
expression

(1:N^2)[which((1:N^2)!=seq(0,(N-1)*N,by=N)+(1:N))]

to get the indices of the non-diagonal entries of a matrix :-)

-- 
Michael Knudsen
micknud...@gmail.com
http://lifeofknudsen.blogspot.com/

______________________________________________
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