Mac R studio安装rJava遇到问题:第一次用博客,求教各位大神

 想要安装rJava和做书上的一个例子遇到的问题,请懂的大神多多帮助。感恩!

> library(rJava)

错误: package or namespace load failed for ‘rJava’:
 loadNamespace()里算'rJava'时.onLoad失败了,详细内容:
  调用: dyn.load(file, DLLpath = DLLpath, ...)
  错误: 无法载入共享目标对象‘/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.so
  Reason: image not found
此外: Warning message:

程辑包‘rJava’是用R版本3.4.2 来建造的 

/////////////////////////////

> library(rgl)
错误: package or namespace load failed for ‘rgl’:
 loadNamespace()里算'rgl'时.onLoad失败了,详细内容:
  调用: dyn.load(file, DLLpath = DLLpath, ...)
  错误: 无法载入共享目标对象‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgl/libs/rgl.so’::
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgl/libs/rgl.so, 6): Library not loaded: /opt/X11/lib/libGLU.1.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgl/libs/rgl.so
  Reason: image not found

> attach(mtcars)
> plot3d(wt, disp, mpg, col="red", size=5)
Error in plot3d(wt, disp, mpg, col = "red", size = 5) : 
  没有"plot3d"这个函数

你可能感兴趣的:(R)