简体   繁体   English

R软件包依赖关系的问题

[英]Problems with R package dependencies

I created an R package which has certain dependencies on other packages. 我创建了一个R程序包,该程序包对其他程序包具有某些依赖性。 So i specified the package name as Imports and Depends in the Description file. 所以我在Description文件中将包名称指定为Imports and Depends。 In the namespace file I specified that the package should be exported. 在命名空间文件中,我指定应导出程序包。 I checked the writing R extensions manual and there doesn't seem to be anything else that I should add. 我检查了编写R扩展手册,似乎没有什么可以补充的。

When I try running the package it is not able to call the functions on which the package depends.Do I need to specify additional parameters to be able to call those functions. 当我尝试运行该程序包时,无法调用该程序包所依赖的函数。是否需要指定其他参数才能调用这些函数。

I am using R version 2.15.0 我正在使用R版本2.15.0

Please help me out with this problem. 请帮我解决这个问题。

Thanks. 谢谢。

NAMESPACE:
import("RHive")
export("bigEDA")
export("procFreq")
export("procUnivariate")

I want all the functions from RHive to be present in the same environment as my package. 我希望RHive的所有功能都可以在与我的软件包相同的环境中使用。 Just not able to do that. 只是无法做到这一点。 I have tried specifying export("RHive") and exportFrom("RHive","rhive.query") This also doesn't work. 我尝试指定export("RHive")exportFrom("RHive","rhive.query")这也行不通。 :( :(

Did you run R CMD check NAMEofYOURpackage in your terminal or shell to test whether your DESCRIPTION and NAMESPACE file are fine? R CMD check NAMEofYOURpackage在终端或外壳R CMD check NAMEofYOURpackage中运行过R CMD check NAMEofYOURpackage以测试您的R CMD check NAMEofYOURpackage和NAMESPACE文件是否正确? This check routine creates the file 00install.out that can give you a hint where something went wrong. 此检查例程将创建文件00install.out,该文件可向您提示出现问题的位置。

If you just want to use functions from foreign packages in your package use the DESCRIPTION file. 如果只想使用软件包中外部软件包的功能,请使用DESCRIPTION文件。 There you just type: Depends: RHive 您只需在Depends: RHive输入: Depends: RHive

Use the export in the NAMESPACE file to export your functions to the user. 使用export命名空间中的文件到您的函数导出到用户。 If you have a function sum() and you want the user who installed your package to be able to use this function use: exportMethods(sum) (you can add more functions right here by separating them with commas) 如果您具有函数sum()并且希望安装软件包的用户能够使用此函数,请使用: exportMethods(sum) (您可以在此处添加更多功能,以逗号分隔)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM