Dplyr 警告:`...` 不为空

Posted

技术标签:

【中文标题】Dplyr 警告:`...` 不为空【英文标题】:Dplyr warns: `...` is not empty 【发布时间】:2020-10-31 16:09:47 【问题描述】:

今天打印tibbles时出现新的警告信息

library(tidyverse)

mtcars %>% 
  head %>%
  as_tibble

打印

# A tibble: 6 x 11
    mpg   cyl  disp    hp  drat    wt  qsec    vs    am  gear  carb
  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1  21       6   160   110  3.9   2.62  16.5     0     1     4     4
2  21       6   160   110  3.9   2.88  17.0     0     1     4     4
3  22.8     4   108    93  3.85  2.32  18.6     1     1     4     1
4  21.4     6   258   110  3.08  3.22  19.4     1     0     3     1
5  18.7     8   360   175  3.15  3.44  17.0     0     0     3     2
6  18.1     6   225   105  2.76  3.46  20.2     1     0     3     1
Warning message:
`...` is not empty.

We detected these problematic arguments:
* `needs_dots`

These dots only exist to allow future extensions and should be empty.
Did you misspecify an argument? 

如何消除该警告?

这是我的sessionInfo()

【问题讨论】:

在我的dplyr/tibble 版本中,我没有收到警告 请不要发布代码/数据/错误的图像:它不能被复制或搜索 (SEO),它会破坏屏幕阅读器,并且它可能不适合某些移动设备。参考:meta.***.com/a/285557(和xkcd.com/2116)。请直接包含代码、控制台输出或数据(例如,dput(head(x))data.frame(...))。 感谢@r2evans -- 按要求进行更改 这个错误似乎是在pillar-1.4.5 中引入的(因为我目前使用的是1.4.4),见github.com/tidyverse/tibble/issues/798。我认为您的选择是(a)如果可以的话,降级到 1.4.4;或 (b) 获取 github 版本的pillar 来修复错误。 (看起来他们正试图加快 CRAN 的发布:github.com/tidyverse/tibble/commit/…) 【参考方案1】:

这个问题不是任何 SO 问题(我可以找到)的重复,但它是 tibble (tibble/#798) 上的一个问题的重复,其中可重现的代码仅仅是:

tibble::tibble(a = 1)
#> Warning: `...` is not empty.
#> 
#> We detected these problematic arguments:
#> * `needs_dots`
#> 
#> These dots only exist to allow future extensions and should be empty.
#> Did you misspecify an argument?
#> # A tibble: 1 x 1
#>       a
#>   <dbl>
#> 1     1

有一个正在工作的补丁 (a384b33),看来他们将推动新的 CRAN 版本。

您的选择是:

    降级

    remotes::install_version("pillar", version = "1.4.4")
    

    安装tibble的github版本

    remotes::install_github("tidyverse/tibble")
    

    或等待 CRAN 发布 (in work)。

【讨论】:

这已通过 tibble 3.0.3 版解决CRAN

以上是关于Dplyr 警告:`...` 不为空的主要内容,如果未能解决你的问题,请参考以下文章

当 WPF 中的绑定为空时,如何避免 xaml 警告?

由于 NFS 升级后目录不为空,rmdir 失败

ShellCheck 警告:“迭代 ls 输出很脆弱。使用 glob。[SC2045]”

仅当搜索栏文本不为空时,如何运行过滤器功能?

为啥 C++/CLI 编译器不为过时的属性调用生成警告?

如何验证jsp表单提交不为空