windows安装R软件包

windows安装R软件包,r,R,我正在运行ubuntu,64位。我有这个最小的测试包 这是我用来学习如何做这些事情的(我遵循这一点,除了我在包中还有一些c代码)。当我跑的时候 R CMD check MySmallPackage 在它上面,它工作得很好(见下文)。那么, 我跑 它也能工作(见下文)。所以现在,我发送 将生成的.tar.gz发送给运行win7 64位的朋友 (和64位R),他会收到以下错误消息: *** arch - i386 ERROR: compilation failed for package 'MyS

我正在运行ubuntu,64位。我有这个最小的测试包 这是我用来学习如何做这些事情的(我遵循这一点,除了我在包中还有一些c代码)。当我跑的时候

R CMD check MySmallPackage
在它上面,它工作得很好(见下文)。那么, 我跑

它也能工作(见下文)。所以现在,我发送 将生成的.tar.gz发送给运行win7 64位的朋友 (和64位R),他会收到以下错误消息:

*** arch - i386
ERROR: compilation failed for package 'MySmallPackage'
* removing 'C:/Users/ES/Documents/R/win-library/2.15/MySmallPackage'
Warning in install.packages :
  running command 'C:/PROGRA~1/R/R-215~1.1/bin/x64/R CMD INSTALL -l "C:/Users/ES/Documents/R/win-library/2.15"   "C:/Users/ES/Downloads/MySmallPackage_0.1.1(1).tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘C:/Users/ES/Downloads/MySmallPackage_0.1.1(1).tar.gz’ had non-zero exit status
这很令人费解。有谁能告诉我是什么导致了这个问题(我已经很多年没有使用windows了,但是这个软件包在linux上安装得很好)。这个错误消息对我来说有点神秘

$ R CMD check MySmallPackage
* using log directory ‘~/MySmallPackage.Rcheck’
* using R version 2.15.2 (2012-10-26)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘MySmallPackage/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘MySmallPackage’ version ‘0.1.1’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking whether package ‘MySmallPackage’ can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking for unstated dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking line endings in Makefiles ... OK
* checking for portable compilation flags in Makevars ... OK
* checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
* checking compiled code ... OK
* checking examples ... OK
* checking PDF version of manual ... OK


$R CMD build MySmallPackage
* checking for file ‘MySmallPackage/DESCRIPTION’ ... OK
* preparing ‘MySmallPackage’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘MySmallPackage_0.1.1.tar.gz’

您需要为Linux、Mac和Windows机器构建不同的软件包

有(至少)四种可能性:

  • 把你的包裹寄存在电脑上。r-forge每晚都会构建一个linux、windows和mac版本的软件包
  • 使用Uwe Ligges维护的在线窗口
  • 向您的朋友发送源代码,并让他在Windows machince上构建软件包。当我在谷歌上搜索“building r packages windows”时,我得到了一些有用的点击
  • 将软件包托管在上,然后使用该软件包安装软件包

  • 谢谢工作并生成了一个可用的.zip文件。但是速度太慢了!我认为这需要一个新的问题。但是4)对构建没有帮助,您仍然需要Rtools。@DirkEddelbuettel True,但是如果您安装了Rtools,它应该是可以的(以非Windows用户的身份发言)。哈?重点(对一些Windows用户来说也是难点)是安装并理解Rtools——您的要点1)到3)解决了这一点。但您使用的远程存储完全是正交的。对不起,github和devtools都不能治愈病人,也不能喂养饥饿的人。这就是为什么你的观点(4)充其量也很有趣。@Dirkedelbuettel我想本地计算机管理员会安装devtools和Rtools,因为它们是“合适的”R软件包。然而,本地计算机管理员没有时间去安装定制的软件包。
    $ R CMD check MySmallPackage
    * using log directory ‘~/MySmallPackage.Rcheck’
    * using R version 2.15.2 (2012-10-26)
    * using platform: x86_64-pc-linux-gnu (64-bit)
    * using session charset: UTF-8
    * checking for file ‘MySmallPackage/DESCRIPTION’ ... OK
    * checking extension type ... Package
    * this is package ‘MySmallPackage’ version ‘0.1.1’
    * checking package namespace information ... OK
    * checking package dependencies ... OK
    * checking if this is a source package ... OK
    * checking if there is a namespace ... OK
    * checking for executable files ... OK
    * checking whether package ‘MySmallPackage’ can be installed ... OK
    * checking installed package size ... OK
    * checking package directory ... OK
    * checking for portable file names ... OK
    * checking for sufficient/correct file permissions ... OK
    * checking DESCRIPTION meta-information ... OK
    * checking top-level files ... OK
    * checking for left-over files ... OK
    * checking index information ... OK
    * checking package subdirectories ... OK
    * checking R files for non-ASCII characters ... OK
    * checking R files for syntax errors ... OK
    * checking whether the package can be loaded ... OK
    * checking whether the package can be loaded with stated dependencies ... OK
    * checking whether the package can be unloaded cleanly ... OK
    * checking whether the namespace can be loaded with stated dependencies ... OK
    * checking whether the namespace can be unloaded cleanly ... OK
    * checking loading without being on the library search path ... OK
    * checking for unstated dependencies in R code ... OK
    * checking S3 generic/method consistency ... OK
    * checking replacement functions ... OK
    * checking foreign function calls ... OK
    * checking R code for possible problems ... OK
    * checking Rd files ... OK
    * checking Rd metadata ... OK
    * checking Rd cross-references ... OK
    * checking for missing documentation entries ... OK
    * checking for code/documentation mismatches ... OK
    * checking Rd \usage sections ... OK
    * checking Rd contents ... OK
    * checking for unstated dependencies in examples ... OK
    * checking line endings in C/C++/Fortran sources/headers ... OK
    * checking line endings in Makefiles ... OK
    * checking for portable compilation flags in Makevars ... OK
    * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
    * checking compiled code ... OK
    * checking examples ... OK
    * checking PDF version of manual ... OK
    
    
    $R CMD build MySmallPackage
    * checking for file ‘MySmallPackage/DESCRIPTION’ ... OK
    * preparing ‘MySmallPackage’:
    * checking DESCRIPTION meta-information ... OK
    * cleaning src
    * checking for LF line-endings in source and make files
    * checking for empty or unneeded directories
    * building ‘MySmallPackage_0.1.1.tar.gz’