Gavin,
I ran into the same cryptic "invalid subscript type 'closure'" message in
a slightly less complicated scenario, and wanted to post the cause in
my case (the root cause is probably the same either way).
Similarly to your case, I was subsetting a data frame. I had a list
of variable names
On Sun, 2009-08-09 at 11:32 -0500, Douglas Bates wrote:
> On Sat, Aug 8, 2009 at 1:31 PM, Gavin Simpson wrote:
> > Dear List,
>
> > I am writing a formula method for a function in a package I maintain. I
> > want the method to return a data.frame that potentially only contains
> > some of the vari
On Sat, Aug 8, 2009 at 1:31 PM, Gavin Simpson wrote:
> Dear List,
> I am writing a formula method for a function in a package I maintain. I
> want the method to return a data.frame that potentially only contains
> some of the variables in 'data', as specified by the formula.
The usual way to call
Dear List,
I am writing a formula method for a function in a package I maintain. I
want the method to return a data.frame that potentially only contains
some of the variables in 'data', as specified by the formula.
The problem I am having is in writing the function and wrapping it
around model.fr
On Thu, 2005-08-18 at 09:00 -0400, Gabor Grothendieck wrote:
> I think this one is a hard call. Designing software is a
> series of tradeoffs. Its nice to maintain consistency with
> the R base, but in case of extensions (rather than changing
> behavior) as in this case, the argument against the c
On Thu, 2005-08-18 at 07:57 +0300, Jari Oksanen wrote:
> On 18 Aug 2005, at 1:49, Gavin Simpson wrote:
>
> > On Wed, 2005-08-17 at 20:24 +0200, Martin Maechler wrote:
> >>> "GS" == Gavin Simpson <[EMAIL PROTECTED]>
> >>> on Tue, 16 Aug 2005 18:44:23 +0100 writes:
> >>
> >> GS> On T
On Wed, 2005-08-17 at 21:48 -0400, Gabor Grothendieck wrote:
> If its just a matter of specifying two data frames how about just
> letting the user specify them as the first two arguments without
> injecting formulas into it so that any of these are allowed but
> data frames are still not allowed i
On 18 Aug 2005, at 1:49, Gavin Simpson wrote:
> On Wed, 2005-08-17 at 20:24 +0200, Martin Maechler wrote:
>>> "GS" == Gavin Simpson <[EMAIL PROTECTED]>
>>> on Tue, 16 Aug 2005 18:44:23 +0100 writes:
>>
>> GS> On Tue, 2005-08-16 at 12:35 -0400, Gabor Grothendieck
>> GS> wrote:
If its just a matter of specifying two data frames how about just
letting the user specify them as the first two arguments without
injecting formulas into it so that any of these are allowed but
data frames are still not allowed in formulas other than in the
data argument:
yourfunction(df1, df2)
y
On Wed, 2005-08-17 at 20:24 +0200, Martin Maechler wrote:
> > "GS" == Gavin Simpson <[EMAIL PROTECTED]>
> > on Tue, 16 Aug 2005 18:44:23 +0100 writes:
>
> GS> On Tue, 2005-08-16 at 12:35 -0400, Gabor Grothendieck
> GS> wrote:
> >> On 8/16/05, Gavin Simpson <[EMAIL PROTECTED
> "GS" == Gavin Simpson <[EMAIL PROTECTED]>
> on Tue, 16 Aug 2005 18:44:23 +0100 writes:
GS> On Tue, 2005-08-16 at 12:35 -0400, Gabor Grothendieck
GS> wrote:
>> On 8/16/05, Gavin Simpson <[EMAIL PROTECTED]>
>> wrote: > On Tue, 2005-08-16 at 11:25 -0400, Gabor
>> Gro
On Tue, 2005-08-16 at 12:35 -0400, Gabor Grothendieck wrote:
> On 8/16/05, Gavin Simpson <[EMAIL PROTECTED]> wrote:
> > On Tue, 2005-08-16 at 11:25 -0400, Gabor Grothendieck wrote:
> > > It can handle data frames like this:
> > >
> > > model.frame(y1)
> > > or
> > > model.frame(~., y1)
On 8/16/05, Gavin Simpson <[EMAIL PROTECTED]> wrote:
> On Tue, 2005-08-16 at 11:25 -0400, Gabor Grothendieck wrote:
> > It can handle data frames like this:
> >
> > model.frame(y1)
> > or
> > model.frame(~., y1)
>
> Thanks Gabor,
>
> Yes, I know that works, but I want the function coc
On Tue, 2005-08-16 at 11:25 -0400, Gabor Grothendieck wrote:
> It can handle data frames like this:
>
> model.frame(y1)
> or
> model.frame(~., y1)
Thanks Gabor,
Yes, I know that works, but I want the function coca.formula to accept a
formula like this y2 ~ y1, with both y1 and y2 bei
It can handle data frames like this:
model.frame(y1)
or
model.frame(~., y1)
On 8/16/05, Gavin Simpson <[EMAIL PROTECTED]> wrote:
> Hi I'm having a problem with model.frame, encapsulated in this example:
>
> y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1),
> n
Hi I'm having a problem with model.frame, encapsulated in this example:
y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1),
nrow = 5, byrow = TRUE)
y1 <- as.data.frame(y1)
rownames(y1) <- paste("site", 1:5, sep = "")
colnames(y1) <- paste("spp", 1:4, sep = "")
y1
model.frame(~ y
16 matches
Mail list logo