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