[Rd] bug report for as.function (PR#7702)

From: <becker_at_kfs.oeaw.ac.at>
Date: Fri 25 Feb 2005 - 01:59:13 EST


Hi,

I got the following message in R:
Error in as.function.default(pdfs[1]) : invalid body argument for "function" Should NEVER happen; please bug.report() [mkCLOSXP]

Operating System: Windows XP (SP2)
R version: R-2.0.1
Code causing error follows:

# create two probability density functions for mixtures of normal
distibutions
fmix1 <- function(x) {dnorm(x, mean=4, sd=2) * 0.5 + dnorm(x, mean=7, sd=1) * 0.5}
fmix2 <- function(x) {dnorm(x, mean=3, sd=1) * 0.4 + dnorm(x, mean=6, sd=2) * 0.6}

# put them together

pdfs <- c(fmix1, fmix2)

# perhaps this is not as it was intended but it leads to the bug.report
message
as.function(pdfs[1])

Meanwhile I solved this problem otherwise. Hope this helps.
Timo



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Feb 25 01:05:27 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:58 EST