Skip to content

Puzzled at generating combinations

2 messages · Richard Cotton, PIKAL Petr

#
Try:
col1 <- paste("r", 1:3, sep="")
col2 <- paste("R", 1:3, sep="")
data.frame(rep(col1, each=3), rep(col2, times=3))

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}
#
Or he can use expand grid

expand.grid(paste("r",1:3, sep=""), paste("R", 1:3, sep=""))

Petr Pikal
petr.pikal at precheza.cz

r-help-bounces at r-project.org napsal dne 18.03.2008 17:15:54:
inform...{{dropped:20}}
http://www.R-project.org/posting-guide.html