2014-10-03 20 views
2

嗨,我正在关注Hilary的教程here和Hadley Wickham的here尝试创建一个虚拟包。R devtools:文档依赖项包不可用

然而,我的包需要一些外部依赖XMLRCurl在这种情况下,当我运行命令文件,它会抱怨说:

> setwd('/home/datafireball/projects/Rprojects/rgetout/rgetout') 
> document() 
Error: could not find function "document" 
> library(devtools) 
> document() 
Updating rgetout documentation 
Loading rgetout 
Loading required namespace: XML 
Error in (function (dep_name, dep_ver = NA, dep_compare = NA) : 
    Dependency package XML not available. 
> 

这是我DESCRIPTION文件。

Package: rgetout 
Title: A R package to get all the outlinks for a given URL 
Version: 0.1 
[email protected]: "Eric Cartman <[email protected]> [aut, cre]" 
Description: This package is intended to include as much web extraction functionality as much as  possible. It starts with one function. getout will extract 
all the outlinks for a given URL with a user-agent that you can customize. 
Depends: R (>= 3.0.2) 
Imports: 
    XML, 
    RCurl 
License: MIT 
LazyData: true 

这是source code github repo如果你想得到更多的信息。

+1

我推测你已经在你的系统上安装了'XML'和'RCurl'.... – mnel 2014-10-03 03:22:19

+0

@mnel,实际上不是,我测试了代码在我的windo上带有XML和RCurl的ws box。然后我将代码复制到我的ubuntu virtualbox中,预计它会按照说明安装软件包? – 2014-10-03 03:47:18

+0

在调用'document()'函数之前,您需要执行'library(devtools)'或'require(devtools)'。 – hrbrmstr 2014-10-03 03:49:00

回答

1

假设您在 这样做时将拥有开发包所需的工具/依赖关系。

utils::install.packages具有依赖性的说法,这将尝试安装在其上包取决于/(在无论怎样,他们都依赖卸载的软件包(建议/取决于/ linkingTo)。

devtools::install_github将同样执行。

安装一个软件包并将其记录为开发组件的部分是安静的不同的活动 。