我正在尝试通过install.packages('xlsx')安装'xlsx' 这告诉我
library("xlsx", lib.loc="/Library/Frameworks/R.framework/Versions/3.4/Resources/library") Loading required package: rJava Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object >' /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.>so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/> rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: > /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.s>o Reason: image not found Error: package ‘rJava’ could not be loaded
经过一番研究,我发现我需要安装rJava,看起来很好。当我通过'packages'点击xlsx和rJava时,它显示了我
library("rJava", >lib.loc="/Library/Frameworks/R.framework/Versions/3.4/Resources/library") Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object >'/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.>so': >dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/>rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: >/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.s>o Reason: image not found
这是针对rJava的
Style
我想知道发生了什么,想知道如何解决它。我从2015年开始使用MacBook Air。 有人说3.4.0还不支持xlxs或rJava。如果你告诉我如何逐步解决这些问题,那将会非常有用。
答案 0 :(得分:0)
查看此处的位置:R, Java, rJava and macOS adventures
你可以在macOS中找到如何处理Java,R,rJava的描述。通常,那里有一些混乱。你必须注意以下几点:
最终,一旦设置了所有内容,就应该让它运行。
我不会在这里发布完整的描述,因为它很长。另外,请注意允许运行基于JNI的代码的JDK设置。您需要确保JDK在
中有适当的设置`/usr/libexec/java_home`/../Info.plist
很多事情要做,但最终应该有效:)
与R一起玩。