[R] Problem with adapt package

Anthony Tate agt at ma.adfa.edu.au
Fri Jun 29 02:11:56 CEST 2001


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 

I am using is SUSE linux 6.4 with the following version of R.

         _
platform i586-pc-linux-gnu
arch     i586
os       linux-gnu
system   i586, linux-gnu
status
major    1
minor    3.0
year     2001
month    06
day      22
language R 

Yours sincerely,

Anthony Tate


---------------------------------------------------------------

Anthony Tate          E-Mail: Anthony Tate <agt at ma.adfa.edu.au>
School of Mathematics and Statistics
UNSW at the Australian Defence Force Academy
Canberra ACT
Australia

Date: 29-Jun-01
Time: 09:58:53

This message is intended for the addressee named and may contain
confidential information.  If you are not the intended recipient, please
delete it and notify the sender.  Views expressed in this message are those
of the individual sender and are not necessarily the views of the University
of New South Wales at the Australian Defence Force Academy



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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