[英]Issues building and installing a created R package
我创建了一个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()工作?
这是DESCRIPTION文件:
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
和NAMESPACE
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:]]+")
错误是
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
考虑到您现在为DESCRIPTION和NAMESPACE发布的内容,这似乎是合理的。
所以这是我会做的:
R CMD build mypackage
R CME check mypackage_1.2.3.tar.gz
这应该使您对源是否处于良好状态有一个清晰的认识。 之后,您可以创建一个二进制文件或zip或...,您的同事应该可以使用。
编辑:当然,您应该为RcppProgress使用grep,您可能确实对它没有声明的依赖关系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.