On Tue, 7 Jul 2009, Allin Cottrell wrote:
Still all hidden, but I've just added a couple of things
provisionally...
A few more developments. First, you can pass series arguments to
R functions and they'll be converted to matrices. Second, I've
tried virtualizing the R functions we use in gretl_foreign.c.
I've got this to work on Linux -- not linking against libR.so, but
dlopen'ing it instead.
There's code in place that should do the same trick on Windows if
R.dll is installed, but I haven't managed to test it yet. If
anyone would like to have a go with the current snapshot
(1.8.2cvs), here's a little test script:
<script>
open data4-1
set R_functions on
foreign language=RLib
ols<-function(y,x) {
m <- lm(y~x+1)
b <- as.matrix(coefficients(m))
invisible(b)
}
end foreign
set messages off
matrix rb = R_ols(price, sqft)
rb
</script>
It may be that using dlopen is a good way to go on all platforms,
rather than linking to libR at compile time.
Allin.