Am 20.10.2016 um 21:09 schrieb Allin Cottrell:
On Thu, 20 Oct 2016, Sven Schreiber wrote:
>
> In a more real-world case I immediately managed to crash gretl,
> though. I'm sure it's because I'm doing foolish stuff on the R side
> before giving gretl the result with "as.matrix()". One suspicion is
> that perhaps R is giving me a sparse matrix which perhaps drives gretl
> crazy. Anyway, as always, a crash should be avoided I guess...
Indeed. If you could send me a crasher case I'll investigate.
Here you go (attention: crashes gretl for me on Windows in the sense of
the running gretl instance is gone):
<hansl-crash>
set R_functions on
foreign language=R
fcheck <- function() {
library(Matrix)
m3 <- sparseMatrix(c(1,2), c(2,3))
m2 <- matrix(rnorm(3))
return( as.matrix( c(m2, m3 ) ))
}
end foreign
matrix hey = R.fcheck()
</hansl-crash>
Apart from that I learned in the meantime that rbind() and cbind() in R
is a better way to glue matrices together.
Thanks,
sven