Hi there,

 

Just wondering if anyone has any tips for using arrays?

 

I am trying to convert the following SAS code to R:

 

 

data A2;  

 set A1;   

 by subject_id;

 retain   BX1-BX10    i; 

 array b(1:10) BX1-BX10 ;

 

 if first.subject_id then do ;

      do j=1 to 10;

       b(j) = .;    

      end;

      i=1;

 end;

 

b(i)  =  BX;

 i = i+1;

 

 if last.subject_id then output;

run ;

 

 

 

Many thanks in advance,

Bronagh

 


        [[alternative HTML version deleted]]

______________________________________________
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