Skip to content
Prev 155701 / 398502 Next

All possible pairs of two variables

Just simple loops as follows:

########################
z = NULL
for (y in 0:10) {
    for (x in 0:y) {
        z = rbind(z, c(x, y))
    }
}
z
########################

Yihui
On Thu, Sep 11, 2008 at 12:34 PM, Ron Michael <ron_michael70 at yahoo.com> wrote: