On building an integrated QuantLib/Lua platform on the world's most popular computer.

Saturday, February 27, 2010

QuantLib R

Things seemed to go well but somehow Date is not working. I do not understand R enough to know what's wrong.

Date(15,'May',1998) produces the error

Error in Date(15, "May", 1998) : could not find function "f"

I'm running QuantLib 1.0, R version 2.10.1.

I've looked at the QuantLib.R file and the problem seems to be at lines about 2087--2108 with the following code.

`Date` <- function(...) {
argtypes <- mapply(class, list(...))
argv <- list(...)
argc <- length(argtypes)
# dispatch functions 4
if (argc == 0) {
f <- Date__SWIG_0
} else if (argc == 1) {
if (extends(argtypes[1], 'integer')) {
f <- Date__SWIG_2
}
} else if (argc == 2) {
if (extends(argtypes[1], 'character') && extends(argtypes[2], 'character')) {
f <- Date__SWIG_3
}
} else if (argc == 3) {
if (extends(argtypes[1], 'integer') && extends(argtypes[2], 'character') && extends(argtype\
s[3], 'integer')) {
f <- Date__SWIG_1
}
}
f(...)
}


Somehow f failes to be defined here.

No comments:

Post a Comment

Followers