创建R包,警告:包'——'是在R版本3.1.2下构建的。

时间:2021-09-09 19:42:33

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

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

  import(fOptions)

My DESCRIPTION file has a line:

我的描述文件有一行:

  Depends:  fOptions

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

但是,当我使用rcmd CHECL(从终端到cran选项)编译我的R包时,我得到以下警告消息:

   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

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

我发现这些都是fOptions的依赖性,因为它的描述文件说:

  Depends: methods, timeDate, timeSeries, fBasics

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

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

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

我使用的是OS X版本10.9.4,而我的R版本是3.1.1(2014-07-10)——“把它给我”。

1 个解决方案

#1


22  

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

那些是警告,而不是错误,这意味着你可以继续,但是如果你解决它们就更好了。

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版本更新的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.

3.1.2 R我建议更新你的版本,这将消除这些警告+你就会拥有一个新的R版本:如果你工作的环境中,你不能更新R,那么很好,你可以继续你的计划与这些警告,它只是理想。

#1


22  

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

那些是警告,而不是错误,这意味着你可以继续,但是如果你解决它们就更好了。

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版本更新的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.

3.1.2 R我建议更新你的版本,这将消除这些警告+你就会拥有一个新的R版本:如果你工作的环境中,你不能更新R,那么很好,你可以继续你的计划与这些警告,它只是理想。