RE: [R] elegant matrix creation

From: Gabor Grothendieck <ggrothendieck_at_myway.com>
Date: Thu 29 Jul 2004 - 04:01:54 EST

Here is yet one more simplification. Note that seq9 in this one is not the same as seq9 in the last one. This one looks much more symmetric in the arguments and is shorter:

seq9 <- function(i) seq(0, len = 9, by = i) jj <- function(i,j) outer( seq9(i), seq9(j), "+" ) %% 9 %/% 3 + 1

jj1. <- jj(3,1)
jj2. <- jj(3,5)
jj3. <- jj(4,1)

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jul 29 04:10:18 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:20 EST