2013-10-21 133 views
0

我创建了一个R软件包。该DESCRIPTION文件这个包是如下:自动安装R软件包

Package: Ralgotree 
Type: Package 
Title: package about securiy information 
Version: 1.0 
Date: 2013-02-15 
Author: algotree 
Maintainer: algotree<[email protected]> 
Description: package about securiy information 
License: GPL(>=2) 
Suggests: RJSONIO,stringr,RSQLite,bigmemory,Rook,compare,plyr,lubridate,xts 
Depends: RJSONIO,stringr,RSQLite,bigmemory,Rook,compare,plyr,lubridate,xts 

它依赖于其他包一样RJSONIOstringr等 所以每当我尝试使用以下命令

R CMD build Ralgotree 
R CMD INSTALL Ralgotree 
安装我的包在其他机器

它显示了以下错误消息:

* installing to library ‘/usr/local/lib/R/site-library’ 
ERROR: dependencies ‘RJSONIO’, ‘stringr’, ‘RSQLite’, ‘bigmemory’, ‘Rook’, ‘compare’, ‘plyr’, ‘lubridate’, ‘xts’ are not available for package ‘Ralgotree’ 

所以我需要做安装所有packag es这样的install.packages("RJSONIO")

当我们运行R CMD INSTALL Ralgotree命令时,是否可以安装所有卸载的软件包? 由于

回答

1

我不认为这是在列出的参数的选项,当我运行:

R CMD INSTALL --help 

install.packages R函数具有“依赖条件”参数,它TRUE时(或合适的字符向量)将收集Description文件中的软件包列表并安装它们。

?install.packages 
2

尝试,

install.packages("mypkg", dependencies = TRUE)