我正在尝试rJava
在装有 Win 7 64 位的计算机上安装。当我跑
install.packages("rJava")
一切似乎都很好:
Installing package(s) into ‘C:/Users/djq/Documents/R/win-library/2.13’
(as ‘lib’ is unspecified)
trying URL 'http://software.rc.fas.harvard.edu/mirrors/R/bin/windows/contrib/2.13/rJava_0.9-1.zip'
Content type 'application/zip' length 654936 bytes (639 Kb)
opened URL
downloaded 639 Kb
package 'rJava' successfully unpacked and MD5 sums checked
The downloaded packages are in
C:\TEMP\RtmpW2eAUw\downloaded_packages
但是当我尝试加载库时library(rJava)
,出现以下错误:
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/me/Documents/R/win-library/2.13/rJava/libs/x64/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error: package/namespace load failed for 'rJava'
我已经安装了 Java JRE(尝试 32 位和 64 位版本)和 JDK(同时使用 32 位和 64 位版本)。我的 R 版本是R version 2.13.1 (2011-07-08)
,我正在使用 RStudio。
如果我尝试使用 32 位 R,我可以rJava
正常加载。问题只是rJava
不能在 R 64 位中运行吗?我如何判断一个包裹是否仅适用于 32 而不是 64?
编辑:刚刚发布R.version()
:
> R.Version()
$platform
[1] "x86_64-pc-mingw32"
$arch
[1] "x86_64"
$os
[1] "mingw32"
$system
[1] "x86_64, mingw32"
$status
[1] ""
$major
[1] "2"
$minor
[1] "13.1"
$year
[1] "2011"
$month
[1] "07"
$day
[1] "08"
$`svn rev`
[1] "56322"
$language
[1] "R"
$version.string
[1] "R version 2.13.1 (2011-07-08)"