依赖于闪亮的 R 包给出了 RJSONIO 警告 [英] R package with dependency on shiny gives RJSONIO warning
问题描述
我的包 CTDesignExplorer 使用闪亮的(和闪亮的孵化器).当我包括
取决于:闪亮
在描述文件中,在 RStudio 中加载包时有警告:
My package CTDesignExplorer uses shiny (and shinyIncubator). When I include
Depends: shiny
in the DESCRIPTION file, there are warnings upon loading the package in RStudio:
.simpleDuplicateClass(def, prev) 中的警告:包RJSONIO"中的 S3 类AsIs"的规范似乎等同于>包BiocGenerics"中的一个,并且没有为此类打开重复的类定义
Warning in .simpleDuplicateClass(def, prev) : the specification for S3 class "AsIs" in package ‘RJSONIO’ seems equivalent to one from >package ‘BiocGenerics’ and is not turning on duplicate class definitions for this class
在命令行 R 中,加载 Shiny 得到多个警告;除了AsIs",还有connect"、file"、pipe"和textConnection".
在 https://github.com/joey711/phyloseq/issues/128,问题据说是在 6 个月前解决的,但在这里,即使在 update.packages("RJSONIO") 之后.版本是 1.0-3,从 2013-03-27.
在 https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004177.html,建议从 NAMESPACE 中删除 RJSONIO.但它不在(或在说明中)在我的包裹中.在闪亮中,它在描述中的进口下.
In command line R, loading shiny gets multiples warnings; in addition to "AsIs", with "connect", "file", "pipe", and "textConnection".
At https://github.com/joey711/phyloseq/issues/128, the issue is supposedly solved 6 months ago, but here it is, even after update.packages("RJSONIO"). Version is 1.0-3, from 2013-03-27.
At https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004177.html, the suggestion was to remove RJSONIO from NAMESPACE. But it's not there (or in DESCRIPTION) in my package. In shiny, it's under Imports in DESCRIPTION.
这可能对代码执行没有影响,但很难确定.无论如何,对于我的用户来说肯定是丑陋的.
This probably has no impact on code execution, but it's hard to be sure. Anyway, sure is ugly for my users to see.
推荐答案
我认为将 Shiny 从 Depends 切换到 Imports 可能会有所帮助.并且,如有必要,在您的 NAMESPACE 文件中使用 importFrom
来导入特定的 Shiny 函数,而不是引入所有的 Shiny.
I think it might help to switch Shiny from Depends to Imports in your package. And, if necessary, use importFrom
in your NAMESPACE file to import specific Shiny functions, instead of bringing in all of Shiny.
http://cran.r-project.org/doc/manuals/R-exts.html#Specifying-imports-and-exports
这篇关于依赖于闪亮的 R 包给出了 RJSONIO 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!