Message-ID: <Pine.GSO.4.20.9912211449450.5357-100000@laplace>
Date: 1999-12-21T14:54:07Z
From: Jonathan Rougier
Subject: generating a sequence
In-Reply-To: <199912211259.MAA28451@toucan.stats.ox.ac.uk>
On Tue, 21 Dec 1999, Prof Brian Ripley wrote:
> I am a bit puzzled here. Why is that n=5 not n=4? Anyway, try
>
> A <- matrix(1, n-1, n-1)
> rA <- row(A)
> rA[rA + col(A) <= n]
Or, in the festive spirit,
n <- 5
rA <- outer(1:n, 1:n, "-")
rA[rA>=1]
Cheers, Jonathan.
Jonathan Rougier Science Laboratories
Department of Mathematical Sciences South Road
University of Durham Durham DH1 3LE
"[B]egin upon the precept ... that the things we see are to be
weighed in the scale with what we know" (Meredith, 1879, The Egoist)
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._