[英]Namespace dependencies not required error although I've used Imports in DESCRIPTION
運行R CMD check
時收到以下錯誤:
Namespace dependencies not required: 'foreach' 'ggplot2' 'magrittr'
我已經找到了上一個問題,並通過確保包裹包含在我的描述文件的Imports
字段中來遵循答案,但我仍然收到錯誤。
這是我的描述文件
Type: Package
Title: mytitle
Version: 0.0.0.9000
Authors@R: c(
person("John", "Doe", email = "johndoe@example.com", role = c("aut", "cre")),
)
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.1)
Imports:
cowplot (>= 0.9.2),
data.table (>= 1.11.4),
doParallel (>= 1.0.11),
foreach (>= 1.2.0),
GA (>= 3.1.1),
ggplot2 (>= 2.1.0),
hydroGOF (>= 0.3.10),
magrittr (>= 1.4),
parallel (>= 3.5.0),
Rcpp (>= 0.12.16)
RoxygenNote: 6.1.0
Roxygen:
list(markdown = TRUE)
LinkingTo:
Rcpp,
RcppArmadillo
Suggests:
testthat
這是我的Roxygen創建的NAMESPACE文件:
export(myfunction)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(cowplot,plot_grid)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
importFrom(hydroGOF,KGE)
importFrom(hydroGOF,NSE)
importFrom(hydroGOF,rmse)
importFrom(hydroGOF,ssq)
importFrom(magrittr,"%>%")
importFrom(parallel,detectCores)
importFrom(parallel,makeCluster)
importFrom(parallel,stopCluster)
useDynLib(mytitle, .registration = TRUE)
你能告訴我我錯過了什么嗎?
當R CMD檢查運行時,它在包的文件夾的父文件夾上構建了一個二進制包.zip文件,並且還調用了一個文件夾pkgname.check。 我認為下次運行R CMD時,它可能無法重建該文件夾或該文件,具體取決於是否在包中進行了更改。 我刪除了那些文件和文件夾並重建,一切正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.