[R] 맥OS에서 R쓰기 1편 – .exe로된 패키지 사용하기

1. 몇몇 패키지들은 .EXE파일로 되어 있어 윈도우에서만 작동가능하다.

이를 해결해 줄 수 있는 것이 XQuartz 이다.

예 – BEFORE)

library(rgl)

Error: package or namespace load failed for ‘rgl’:
.onLoad failed in loadNamespace() for ‘rgl’, details:
call: dyn.load(file, DLLpath = DLLpath, …)
error: unable to load shared object ‘/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

예 – AFTER)

library(rgl)
example(plot3d)

plot3d> open3d()
glX
1

plot3d> x <- sort(rnorm(1000))

plot3d> y <- rnorm(1000)

plot3d> z <- rnorm(1000) + atan2(x, y)

plot3d> plot3d(x, y, z, col = rainbow(1000))

    Leave Your Comment

    Forgot Password