ordering x's and y's
Hi Andrew.
This was asked a few days ago (but I posted my offering offline)..
Try:
library(gregmisc)
do.thing2 <- function(x,y) {
a <- c(x,y)
tt <- combinations(length(a),length(x))
answer <- matrix(NA,nrow(tt),length(a))
for(i in 1:nrow(tt)) {
answer[i, tt[i,]] <- x
answer[i,-tt[i,]] <- y
}
return(answer)
}
[anyone got a vectorized version?]
best
rksh
Robin Hankin, Lecturer, School of Geography and Environmental Science Tamaki Campus Private Bag 92019 Auckland New Zealand r.hankin at auckland.ac.nz tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 as of: Wed Dec 11 17:08:00 NZDT 2002 This (linux) system up continuously for: 468 days, 22 hours, 50 minutes