[18644] in s-news-athena

home help back first fref pref prev next nref lref last post

Re: [S] vector of 1:n

daemon@ATHENA.MIT.EDU (Dave Krantz)
Fri Jul 16 09:20:36 1999

Date: Fri, 16 Jul 1999 09:14:53 -0400 (EDT)
From: Dave Krantz <dhk@paradox.psych.columbia.edu>
Message-Id: <199907161314.JAA28263@paradox.psych.columbia.edu>
To: hodgess@uhdux2.dt.uh.edu
Cc: dhk@paradox.psych.columbia.edu, s-news@wubios.wustl.edu


A simple one-liner:

	rep(1:n, n)[outer(1:n, 1:n, ">=")]

will generate the vector you want, 1, ..., n, 2, ..., n, ..., n-1, n, n.

Dave Krantz
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post