On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote: > teams <- LETTERS[1:11] > matches <- combn(teams, 2) > draw <- data.frame(team1=matches[1,], team2=matches[2,]) > > # someone will know how to do this in one line... > time <- numeric(55) > k <- 0 > for (i in 1:10) { > t0 <- 2*i - 1 > n <- 10 - i + 1 > for (j in t0:(t0+n-1)) { > k <- k+1 > time[k] <- (j-1) %% 10 + 1 > } > }
Shouldn't there be 11 rounds? This way you have one team playing twice in every round. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd....@cbs.dk Priv: pda...@gmail.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.