[R] Problem with adapt package

Jonathan Rougier J.C.Rougier at durham.ac.uk
Fri Jun 29 13:05:23 CEST 2001


Hi Anthony,

Anthony Tate wrote:
> 
> I am having problems using the adapt add on package to integrate a function
> over 2 dimensions, using the following code.
> 
> library(adapt)
> 
> alb1 <- function(p,X,th,alpha){
>    y <- p[1]; z <- p[2]
>    c <- sqrt((X + z*tan(th))^2 + z^2)
>    r <- sqrt(c^2 + y^2)
>    exp(-alpha*r) / r^3
> }
> 
> x <- 0.05
> y <- x
> w <- 0.5
> delta <- 0.1
> czang <- pi/4
> alpha <- 15.0
> y[i] <- adapt(ndim=2, lower=c(0,0), upper=c(w,delta),
>         minpts=1000, maxpts=10^6, funct=alb1,  eps=0.005,
>         X=x, th=czang, alpha=alpha)$value
> 
> The code gives the following error
> 
> Error in function (p, X, th, alpha)  : Argument "X" is missing, with no default

This is a bug that I thought we had squashed.  Crudely there is a "..."
missing in the line "ff<-functn".  I have a feeling that Martin fixed
this with some tricky code using ".Alias", but the fix has not appeared
on CRAN.  Martin?!

Cheers, Jonathan.

-- 
Jonathan Rougier                       Science Laboratories
Department of Mathematical Sciences    South Road
University of Durham                   Durham DH1 3LE
tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388
http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list