使用RSQLite库时加载MacPorts SQLite3 [英] Load MacPorts SQLite3 when using RSQLite library

查看:91
本文介绍了使用RSQLite库时加载MacPorts SQLite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQLite中有一个用户定义的函数(用于计算产品的聚合器),并且在R之外可以正常工作.但是有时候我在Mac上,如果需要,则需要MacPorts版本的SQLite3添加您自己的功能/扩展.

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.

我可以选择RSQLite加载哪个SQLite3吗?我在SQLite文档中什么都没看到.

Can I pick which SQLite3 that RSQLite loads? I don't see anything in the SQLite documentation.

此外,MacPorts似乎将我的sqlite3链接更改为安装了MacPorts的SQLite3:

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

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

但是,如果要在SQLite3中加载扩展名,则必须显式地启用MacPorts版本,如下所示:

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

是否正在编写自己的SQLite函数并将其与R组合在一起而导致丢失?谢谢!

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

推荐答案

您是否已安装并加载了RSQLite.extfuns软件包?它具有单个功能,可加载可用功能:

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)

默认情况下,这些是 Healy扩展

这篇关于使用RSQLite库时加载MacPorts SQLite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆