创建 R 包,警告:包‘---’是在 R 版本 3.1.2 下构建的 [英] Creating R package, Warning: package ‘---’ was built under R version 3.1.2

查看:15
本文介绍了创建 R 包,警告:包‘---’是在 R 版本 3.1.2 下构建的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建自己的 R 包,它依赖于 R 包中定义的名为 fOption 的函数.我的 NAMESPACE 文件有一行:

I am creating my own R package which depends on a function defined in R-package named fOption. My NAMESPACE file has a line:

  import(fOptions)

我的DESCRIPTION文件有一行:

My DESCRIPTION file has a line:

  Depends:  fOptions

但是,当我从终端使用 R CMD CHECL --as-cran 选项编译我的 R 包时,我收到以下警告消息:

However, when I compile my R package using R CMD CHECL --as-cran option from the terminal, I get the following warning messages:

   Found the following significant warnings:
   Warning: package ‘timeDate’ was built under R version 3.1.2
   Warning: package ‘timeSeries’ was built under R version 3.1.2
   Warning: package ‘fBasics’ was built under R version 3.1.2

我发现这些是 fOptions 的依赖项,正如它的描述文件所说:

I found that these are dependencies of fOptions as its description file says:

  Depends: methods, timeDate, timeSeries, fBasics

这是否意味着我无法创建依赖于这个特定 R 包 (fOption) 的 R 包?

Does this mean that I cannot create my R package that depend on this particular R package (fOption)?

我使用的是 OS X 版本 10.9.4,而我的 R 版本是 3.1.1 (2014-07-10) -- Sock it to Me".

I am using OS X Version 10.9.4 and My R version is 3.1.1 (2014-07-10) -- "Sock it to Me".

推荐答案

这些是警告,而不是错误,这意味着您可以继续,但最好解决它们.

Those are warnings, not errors, which means you can proceed but it's better if you address them.

在这种情况下,您会收到警告,因为您需要的一些包是使用比您正在运行的 R 版本更新的 R 版本构建的.这可能是一个问题,尽管它可能不是问题,因此它只是一个警告.例如,如果这些包中的任何一个在较新的 R 版本中具有不同的行为,这将是至关重要的,尽管情况可能并非如此.

In this case, you're getting the warnings because a few of the packages you need were built using an R version that is newer than the R version you are running. This can potentially be a problem, though it's likely not a problem, hence it's just a warning. If any of those packages have a different behaviour in the newer R version, for example, this would be critical, though that's likely not the case.

我建议将您的 R 版本更新到 3.1.2,这样可以消除这些警告,而且您将拥有更新的 R 版本 :) 如果您在无法更新 R 的环境中工作,那没关系,您可以继续使用带有这些警告的包,这并不理想.

I would suggest updating your R version to 3.1.2, and that would get rid of these warnings plus you'll have a newer R version :) If you are working in an environment where you cannot update R, then it's fine, you can go on with your package with these warnings, it's just non-ideal.

这篇关于创建 R 包,警告:包‘---’是在 R 版本 3.1.2 下构建的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆