Re: [R] macro facility in R

From: Thomas Lumley <>
Date: Tue 04 Jul 2006 - 02:32:19 EST

On Mon, 3 Jul 2006, John Sorkin wrote:
> R 2.2 on windows XP
> I have a dataset with multiple columns. Some of the columns represent
> independent variables, some represent dependent variables. I would like
> to run the same analyses on a fixed set of independent variables,
> changing only the dependent variable, e.g.
> y1-y2=x1+x2+x3
> y3-y4=x1+x2+x3
> y5-y6=x1+x2+x3, etc.

Other people have mentioned my defmacro() function in R-news, however when I have to do this sort of thing I usually use substitute or bquote

For example

for(i in 1+(1:5)*2){


         -thomas mailing list PLEASE do read the posting guide! Received on Tue Jul 04 02:36:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 04 Jul 2006 - 04:14:41 EST.

Mailing list information is available at Please read the posting guide before posting to the list.