Two questions about R integration
Hi, I have 2 questions about R integration. 1) I see that missing packages are automatically installed when invoked by library() calls. That is really cool. The question: if I need a library in a function, will this actually be loaded at every function call? 2) How is a SQL type date translated to R? Apparently not "Date", because I tried to use it as such in the declared procedure and I got a complaint. I tried to figure the type myself with this: sql> create function dt(d date) returns string language R { class(d) }; sql> select dt( cast('2015-09-21' as date) ); but unfortunately this triggered a server assertion :/ mserver5: .../src/monetdb5/mal/mal_interpreter.c:648: runMALsequence: Assertion `t == stk->stk[a].vtype' failed. Thanks, Roberto
Hi Roberto,
On 21 Sep 2015, at 19:25, Roberto Cornacchia
wrote: I have 2 questions about R integration. 1) I see that missing packages are automatically installed when invoked by library() calls. That is really cool. The question: if I need a library in a function, will this actually be loaded at every function call? It should not. library() checks the search() output and will only load packages not present there.
2) How is a SQL type date translated to R? Apparently not "Date", because I tried to use it as such in the declared procedure and I got a complaint. So far, they are not treated correctly. I hope to fix this before the next release. So cast them to strings or so before passing to R.
I tried to figure the type myself with this:
sql> create function dt(d date) returns string language R { class(d) }; sql> select dt( cast('2015-09-21' as date) );
but unfortunately this triggered a server assertion :/
mserver5: .../src/monetdb5/mal/mal_interpreter.c:648: runMALsequence: Assertion `t == stk->stk[a].vtype' failed.
Will make a test case out of this. Thanks! Hannes
Perfect, thanks!
On 22 September 2015 at 13:12, Hannes Mühleisen
Hi Roberto,
On 21 Sep 2015, at 19:25, Roberto Cornacchia < roberto.cornacchia@gmail.com> wrote: I have 2 questions about R integration.
1) I see that missing packages are automatically installed when invoked by library() calls. That is really cool. The question: if I need a library in a function, will this actually be loaded at every function call? It should not. library() checks the search() output and will only load packages not present there.
2) How is a SQL type date translated to R? Apparently not "Date", because I tried to use it as such in the declared procedure and I got a complaint. So far, they are not treated correctly. I hope to fix this before the next release. So cast them to strings or so before passing to R.
I tried to figure the type myself with this:
sql> create function dt(d date) returns string language R { class(d) }; sql> select dt( cast('2015-09-21' as date) );
but unfortunately this triggered a server assertion :/
mserver5: .../src/monetdb5/mal/mal_interpreter.c:648: runMALsequence: Assertion `t == stk->stk[a].vtype' failed.
Will make a test case out of this. Thanks!
Hannes
_______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Hannes Mühleisen
-
Roberto Cornacchia