我在 R 中运行以下代码,但它失败了:
load(url("http://pages.stat.wisc.edu/~karlrohe/netsci/data/madStuff.RData"))
iplot(madStuff[,1], madStuff[,2])
ibar(madStuff[,8])
sort(table(madStuff[,8]))
ibar(madStuff[,3])
table(madStuff[,4])
nas = which(madStuff[,4] =="")
madStuff[nas,4] = "NA"
ibar(madStuff[,4])
当我运行JGR()
. 知道有什么解决办法吗?
更新:
Monas-MacBook-Pro:stat992 mona$ R CMD javareconf
Java interpreter : /usr/bin/java
Java version : 1.7.0_60
Java home path : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Non-system Java on OS X
trying to compile and link a JNI progam
detected JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/../include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/../include/darwin -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c conftest.c -o conftest.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o conftest.so conftest.o -L/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/server -ljvm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/darwin
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
和
Monas-MacBook-Pro:stat992 mona$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)