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 <[EMAIL PROTECTED]> wrote:
> I have two variables (x,y) :
>
> x : it takes all integer values from 0 to y and,
> y : takes all values from 0, 10
>
> I am looking for some R code to find all possible pairs of (x,y). Can anyone 
> please help me?
>
>
>

-- 
Yihui Xie <[EMAIL PROTECTED]>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China

______________________________________________
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.

Reply via email to