From tlumley at u.washington.edu  Wed Jan 19 19:09:34 2005
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Wed Jan 19 19:09:52 2005
Subject: [Rd] Should NEVER happen;
In-Reply-To: <67DCA285A2D7754280D3B8E88EB5480206741E23@MSGBOSCLB2WIN.DMN1.FMR.COM>
References: <67DCA285A2D7754280D3B8E88EB5480206741E23@MSGBOSCLB2WIN.DMN1.FMR.COM>
Message-ID: <Pine.A41.4.61b.0501191007070.332684@homer11.u.washington.edu>

On Tue, 18 Jan 2005, McGehee, Robert wrote:

> ... which is equivalent to this:
> as.function(list(function(x){}))
>
> which doesn't really make sense (and is the same as part #2 of bug 7495
> reported earlier anyway).

And I think Berwin Turlach reported it much ealier, too.

Still, it is a good thing to report a bug when the program asks you to.

 	-thomas


>
> Jeroen, notice that w_R.fc[2] is a list containing a function, and not
> the function itself. Not sure what this construct is good for, but if
> you want to make lists of functions, use "[[" to index the list.
>
> Also, I think the R patch may be as easy as adding the line
>
> stopifnot(is(x[[1]], "language"))
>
> to the as.function(x, ...) code
>
> --Robert
>
> -----Original Message-----
> From: jjvanhoutte@ucdavis.edu [mailto:jjvanhoutte@ucdavis.edu]
> Sent: Tuesday, January 18, 2005 8:25 PM
> To: r-devel@stat.math.ethz.ch
> Cc: R-bugs@biostat.ku.dk
> Subject: [Rd] Should NEVER happen; please bug.report() [mkCLOSXP]
> (PR#7535)
>
>
> I'm probably not using the function right, but anyway, the program said:
> "please bug.report."
>
>> w_R.f1=function(PR,Pc) return (Pc*PR^3)
>>
>> w_R.f2=function(PR,Pc) return (Pc*PR)
>>
>> w_R.fc=c(w_R.f1,w_R.f2)
>> w_R.fc[2]
> [[1]]
> function(PR,Pc) return (Pc*PR)
>
>>
>> RSD(type=3,
> + gparP=gpar(col="red"),
> + gparD=gpar(fill=FALSE,col=FALSE),
> + gparL=gpar(col="red",lwd=2),
> + gparSL=gpar(col=grey(0.5),lwd=2),
> + gparS=gpar(fill=FALSE,col=FALSE),
> + gparSP=gpar(col=grey(0.7)),
> + w_R.f=w_R.fc[2]
> + )
> Error in R2SDgraph(...) : couldn't find function "w_R.f"
>> as.function(w_R.fc[2])
> Error in as.function.default(w_R.fc[2]) : invalid body argument for
> "function"
> Should NEVER happen; please bug.report() [mkCLOSXP]
>
> --please do not edit the information below--
>
> Version:
> platform = i386-pc-mingw32
> arch = i386
> os = mingw32
> system = i386, mingw32
> status =
> major = 2
> minor = 0.1
> year = 2004
> month = 11
> day = 15
> language = R
>
> Windows XP Home Edition (build 2600) Service Pack 2.0
>
> Search Path:
> .GlobalEnv, package:grid, package:methods, package:stats,
> package:graphics,
> package:grDevices, package:utils, package:datasets, Autoloads,
> package:base
>
> Respectfully,
> Jeroen
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley@u.washington.edu	University of Washington, Seattle


[Rd] Should NEVER happen;
Thomas Lumley