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

Showing posts with label R. Show all posts
Showing posts with label R. Show all posts

Sunday, April 4, 2010

QuantLib-Python + R-Python

Is it possible to have these three objects work seamlessly? Can I move the SWIG objects pointed to in Python to R?

Saturday, April 3, 2010

Fixed QuantLib R error

Needed to chage the Date function in QuantLib.R.

The simple function: todaysDate <- Date(15, "May", 1998)
refused to run because Date (line 2088) was buggy.

Date needed to be changed. It called functions
extends(argtypes[1], 'integer')

That integer should be changed to numeric in all three cases.

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.

Followers