开发者

Load MacPorts SQLite3 when using RSQLite library

I have a user defined function in SQLite (an aggregator that calculates the product) and it works fine outside R. But I'm on a Mac some of the time, which requires the MacPorts version of SQLite3 if you'd like to add your own functions/extensions.

Can I pick which SQLite3 that RSQLite loads? I don't see a开发者_StackOverflow社区nything in the SQLite documentation.

Also, MacPorts appears to change my sqlite3 link to the MacPorts installed SQLite3:

mbp:~ richard$ which sqlite3
/opt/local/bin/sqlite3

But if I want to load the extension in SQLite3, I have to explicitly can the MacPorts version, like this:

mbp:~ richard$ /opt/local/bin/sqlite3 temp.sqlite

Is writing my own SQLite functions and combining them with R a lost cause? Thanks!


Have you installed and loaded the RSQLite.extfuns package? It has a single function which loads the available functions:

db <- dbConnect(SQLite(), dbname = ":memory:")
init_extensions(db)

By default these are the Healy extensions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜