我已经创建了一个R包(还没有在CRAN上),并将它发送给一个同事(作为一个.zip文件)。
不幸的是,如果没有R抛出一个错误,他们就无法正确构建/安装它。
收到的错误是:
Error: Command failed (1)
In addition: Warning message:
The following packages are referenced using Rcpp::depends attributes however are not listed in the Depends, Imports or LinkingTo fields of the package DESCRIPTION file: RcppProgress 为了创建包,我在R v.3.4.3中使用了RcppArmadillo.package.skeleton()函数。
我为我自己工作,但不是为我的同事工作。
我建造/安装的方法是:
build("package name") # creates a .tar.gz file
install("package name")只需将.tar.gz文件发送给我的同事并运行install()就行了吗?
以下是描述文件:
Package: HACSim
Type: Package
Title: Iterative simulation of species haplotype accumulation curves
Version: 1.0
Date: 2018-04-06
Author: Jarrett Phillips
Maintainer: Jarrett Phillips
Description: Iterative simulation of species haplotype accumulation curves for assessment of sampling completeness
License: GPL (>= 3)
NeedsCompilation: Yes
Imports: ape (>= 5.0),
boot (>= 1.3-20),
investr (>= 1.4.0),
mgcv (>= 1.8-23),
pegas (>= 0.10),
Rcpp (>= 0.12.16),
scam (>= 1.2-2)
LinkingTo: Rcpp,
RcppArmadillo和命名空间
useDynLib(HACSim, .registration=TRUE)
importFrom(Rcpp, evalCpp)
importFrom(ape, base.freq)
importFrom(ape, read.dna)
importFrom(boot, boot)
importFrom(boot, boot.ci)
importFrom(investr, predFit)
importFrom(MASS, mvrnorm)
importFrom(mgcv, gam)
importFrom(mgcv, gam.check)
importFrom(mgcv, predict.gam)
importFrom(pegas, haplotype)
importFrom(rootSolve, uniroot.all)
importFrom(rootSolve, multiroot)
importFrom(scam, scam)
importFrom(scam, scam.check)
importFrom(scam, predict.scam)
exportPattern("^[[:alpha:]]+")发布于 2018-05-14 01:04:41
错误是
The following packages are referenced using Rcpp::depends attributes \
however are not listed in the Depends, Imports or LinkingTo fields of\
the package DESCRIPTION file: RcppProgress考虑到您现在发布的描述和名称空间,这似乎是合理的。
所以我要做的是:
R CMD build mypackageR CME check mypackage_1.2.3.tar.gz这应该给你一个明确的想法,你的来源是否在良好的状态。在那之后,你可以创建一个二进制或者压缩或者..。你的同事应该能利用。
编辑:当然,对于RcppProgress,您应该使用grep,而实际上您可能有一个未声明的依赖项。
https://stackoverflow.com/questions/50321594
复制相似问题