关于部分参数匹配的永无休止的警告

时间:2018-11-15 17:47:53

标签: r tidyr

在某些时候,我不断收到有关部分参数匹配的警告。例如,下面的代码在没有参数的情况下:

require(tidyverse)
#> Loading required package: tidyverse
x <- structure(list(unitid = 100654, year = 2006, state_of_residence_when_student_was_first_admitted = "Alabama", 
                    state_of_residence_original_line_number_on_survey_form = "Alabama", 
                    first_time_degree_certificate_seeking_undergraduate_students = 651, 
                    first_time_degree_certificate_seeking_undergraduate_students_who_graduated_from_high_school_in_the_past_12_months = 602), class = c("tbl_df", 
                                                                                                                                                        "tbl", "data.frame"), row.names = c(NA, -1L))

x
#> # A tibble: 1 x 6
#>   unitid  year state_of_reside… state_of_reside… first_time_degr…
#>    <dbl> <dbl> <chr>            <chr>                       <dbl>
#> 1 100654  2006 Alabama          Alabama                       651
#> # ... with 1 more variable:
#> #   first_time_degree_certificate_seeking_undergraduate_students_who_graduated_from_high_school_in_the_past_12_months <dbl>

reprex package(v0.2.1)于2018-11-15创建

我得到的警告是:

Warning messages:
1: In seq.default(along = x) :
partial argument match of 'along' to 'along.with'
2: In seq.default(along = x) :
partial argument match of 'along' to 'along.with'

image

我总是得到各种不同的代码。这会发生在别人身上吗? tidyverse是否是已知问题(我的搜索没有任何结果)。还是我在设置中搞砸了导致该问题的内容?

2 个答案:

答案 0 :(得分:3)

珍妮·布莱恩(Jenny Bryan)为我解决了这个问题。它是R 3.5.1中的一个错误,已经修复,但是尚未发布具有该修复程序的版本。

在此处查看错误报告: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17449

答案 1 :(得分:1)

这些选项控制部分匹配的警告:

  • warnPartialMatchArgs:(logical)如果为TRUE,则在参数匹配中使用部分匹配时发出警告。
  • warnPartialMatchAttr:(logical)如果为TRUE,则警告通过attr提取属性时是否使用了部分匹配。
  • warnPartialMatchDollar:(logical)如果为TRUE,则警告如果$使用部分匹配进行提取。

检查是否设置了它们,以及从何处设置了它们,或者完全禁用它,或者在您只想减少噪音的部分周围将其禁用。

也参考:http://kevinushey.github.io/blog/2015/02/02/rprofile-essentials/