From ggrothendieck at gmail.com  Sun Apr  3 03:10:59 2005
From: ggrothendieck at gmail.com (Gabor Grothendieck)
Date: Sun Apr  3 03:11:14 2005
Subject: [Rd] formulas and frames
In-Reply-To: <20050402203520.GD8581@stat.umn.edu>
References: <200503051102.j25B2jec015493@hypatia.math.ethz.ch>
	<20050401073151.GA13433@stat.umn.edu>
	<006c01c536cc$16bf9610$0540210a@www.domain>
	<20050402203520.GD8581@stat.umn.edu>
Message-ID: <971536df050402171059c30418@mail.gmail.com>

On Apr 2, 2005 3:35 PM, Charles Geyer <charlie@stat.umn.edu> wrote:
> On Fri, Apr 01, 2005 at 05:04:23PM +0200, Dimitris Rizopoulos wrote:
> > if I understand well you want something like this:
> >
> > y <- rnorm(100)
> > p <- rnorm(100)
> > x1 <- rnorm(100)
> > x2 <- rnorm(100)
> > x3 <- rnorm(100)
> > nams <- c("y", "p", paste("x", 1:3, sep=""))
> > ##############
> > dat <- as.data.frame(lapply(nams, get))
> > names(dat) <- nams
> > dat
> >
> > I hope it helps.
> 
> Yes, that's it.  Thanks.

With that, maybe you could use a notation like this
where the predecessor variables are after the bar:

	fo <- cbind(a, b) ~ c + I(c^2)*f | d + e

	all.vars(fo) # all variables 
	all.vars(fo[[2]]) # response variables
	all.vars(fo[[3]][[2]]) # explanatory variables
	all.vars(fo[[3]][[3]]) # predecessor variables


[Rd] formulas and frames
Gabor Grothendieck