[Rd] possible bug in model.frame.default
Robert Gentleman
rgentlem at fhcrc.org
Wed Mar 7 16:59:30 CET 2007
Please update to the latest snapshot
R version 2.5.0 Under development (unstable) (2007-03-05 r40816)
where all is well,
Thibaut Jombart wrote:
> Dear list,
>
> I may have found a bug in model.frame.default (called by the lm function).
> The problem arises in my R dev version but not in my R 2.4.0.
> Here is my config :
>
> > version
>
> _
> platform
> x86_64-unknown-linux-gnu
> arch
> x86_64
> os
> linux-gnu
> system x86_64,
> linux-gnu
> status Under development
> (unstable)
> major
> 2
> minor
> 5.0
> year
> 2007
> month
> 03
> day
> 04
> svn rev
> 40813
> language
> R
> version.string R version 2.5.0 Under development (unstable) (2007-03-04
> r40813)
>
> Now a simple example to (hopefully) reproduce the bug (after a
> rm(list=ls())):
>
> > dat=data.frame(y=rnorm(10),x1=runif(10),x2=runif(10))
> > weights=1:10/(sum(1:10))
> > form <- as.formula("y~x1+x2")
> # here is the error
> > lm(form,data=dat,weights=weights)
> Erreur dans model.frame(formula, rownames, variables, varnames, extras,
> extranames, :
> type (closure) incorrect pour la variable '(weights)'
>
> (sorry, error message is in French)
>
> As I said, these commands works using R.2.4.0 (same machine, same OS).
> Moreover, the following commands work:
> > temp=weights
> > lm(form,data=dat,weights=temp)
>
> This currently seems to cause a check fail in the ade4 package. I tried
> to find out where the bug came from: all I found is the (potential) bug
> comes from model.frame.default, and more precisely:
> debug: data <- .Internal(model.frame(formula, rownames, variables,
> varnames,
> extras, extranames, subset, na.action))
> Browse[1]>
> Erreur dans model.frame(formula, rownames, variables, varnames, extras,
> extranames, :
> type (closure) incorrect pour la variable '(weights)'
>
> I couldn't go further because of the .Internal. I tried to googlise
> this, but I found no such problem reported recently.
>
> Can anyone tell if this is actually a bug? (In case not, please tell me
> where I got wrong).
>
> Regards,
>
> Thibaut.
>
--
Robert Gentleman, PhD
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
206-667-7700
rgentlem at fhcrc.org
More information about the R-devel
mailing list