RQuantLib无法加载 [英] RQuantLib fails to load
问题描述
我最近更新了所有软件包.现在,RQuantLib无法加载.我能做什么?我试图从CRAN和源文件中删除并重新安装版本0.3.12的软件包,都无济于事.
I've recently updated all packages. Now RQuantLib fails to load. What can I do? I've tried to remove and reinstall the package in version 0.3.12 both from CRAN and from the source file, neither helps.
> library(RQuantLib)
Error : .onLoad failed in loadNamespace() for 'RQuantLib', details:
call: if (is.character(qc) && nchar(qc) > 1) {
error: missing value where TRUE/FALSE needed
In addition: Warning message:
running command 'bash -c 'type -p quantlib-config' 2>/dev/null' had status 1
Error: package or namespace load failed for ‘RQuantLib’
我正在Mac OS Mavericks上的R Studio中使用R 3.0.2.我该怎么办?
I'm working in RStudio with R 3.0.2 on Mac OS Mavericks. What can I do?
推荐答案
我遇到了同样的问题,经过数小时的努力,我设法使用了一些不太严格的方法,但它确实有效!R 似乎在评估 system("bash -c 'type -p quantlib-config'")
时遇到了一些问题.安装QuantLib后,在Terminal中键入命令 bash -c'type -pquantlib-config'
,可以为我们提供我们的Quantlib-config路径/opt/local/bin/quantlib-config
.
I had the same issue and after some hours of struggle I manage to use something not very rigorous but it works!
It seems that R has some issues evaluating system("bash -c 'type -p quantlib-config'")
.
After having installed QuantLib, typing the command bash -c 'type -p quantlib-config'
in Terminal gives us the path of our quantlib-config which is for me /opt/local/bin/quantlib-config
.
所以我回到了RQuantLib的 source 文件夹(版本0.4.0),并用以下命令替换了 R/inline.R
文件中的qc:
So I went back to my source folder for RQuantLib (version 0.4.0) and replaced qc in file R/inline.R
by:
qc<-as.character("/opt/local/bin/quantlib-config")
,并使用终端命令 R CMD install RQuantLib/
重建软件包.正如我所说,不是很性感,但是很有效.必须重新启动R和Rstudio.
and rebuilt the package using the terminal command R CMD install RQuantLib/
.
As I said, not very sexy but it works.
A restart of R and Rstudio is necessary.
希望它对下一个有帮助,以后的版本中将对此进行纠正.
Hope it helps the next ones and that this will be corrected in future versions.
这篇关于RQuantLib无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!