I have datasets called example1,example2,example3,example4 of which variable is SEX(1 or 2) in working library and I've made datasets called exampleS1,exampleS2,exampleS3,exampleS4 restricted to SEX=1 by using MACRO in SAS
like this way.
%macro ms(var=);
data exampleS&var.;
set example&var.; IF SEX=1;
run;
%mend ms;%ms(var=1);%ms(var=2);%ms(var=3);%ms(var=4);
Now, I want to do this job in R It's bit not easy to do this in R to me. How can I do it? (assuming example1,example2, example3,example4 are data.frames)
Thank you in advance.