[R] Re : LOOPS

ssim@lic.co.nz ssim at lic.co.nz
Mon Dec 6 01:36:37 CET 2004

Dear lists,

I want to construct a loop in R, but don't know how to do it. I can do it
in SAS, but I prefer in R  (which I am hoping I will off SAS for good
soon). Could anyone help me to convert the SAS codes to equivalent R codes.

Basically, the following codes were written to establish the sire gametes
or phases for daughter design for one markers two alleles.

Here are the SAS code:

do i=1 to 744;
      do j=745 to 1540;
            if sire[j]=anml[i] then do;
                if m1[j]=m1[i]  and m2[j]=m2[i] then m[j]=0;
                else if m1[j]=m1[i] then m[j] =1;
                else if m1[j]=m2[i] then m[j==2;
                else if m2[j]=m1[i] then m[j]=1;
                else if m2[j]=m2[i] then m[j]=2;
                else m[j]=0;
            end do;

Thanks Stella
This message, including attachments, is confidential. If you...{{dropped}}

More information about the R-help mailing list