2
嗨,我正在关注Hilary的教程here和Hadley Wickham的here尝试创建一个虚拟包。R devtools:文档依赖项包不可用
然而,我的包需要一些外部依赖XML
和RCurl
在这种情况下,当我运行命令文件,它会抱怨说:
> 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如果你想得到更多的信息。
我推测你已经在你的系统上安装了'XML'和'RCurl'.... – mnel 2014-10-03 03:22:19
@mnel,实际上不是,我测试了代码在我的windo上带有XML和RCurl的ws box。然后我将代码复制到我的ubuntu virtualbox中,预计它会按照说明安装软件包? – 2014-10-03 03:47:18
在调用'document()'函数之前,您需要执行'library(devtools)'或'require(devtools)'。 – hrbrmstr 2014-10-03 03:49:00