自rlang 0.2.0起,列表已不推荐使用

自rlang 0.2.0起,列表已不推荐使用,r,tidyverse,rlang,R,Tidyverse,Rlang,我正在运行一些R代码,并收到以下警告消息 Warning message: `list_len()` is soft-deprecated as of rlang 0.2.0. Please use `new_list()` instead This warning is displayed once per session. 值得一提的是,调用代码如下所示 df = convertCallCountsToHashTable(call_counts_hash_table ) df

我正在运行一些R代码,并收到以下警告消息

Warning message:
`list_len()` is soft-deprecated as of rlang 0.2.0.
Please use `new_list()` instead
This warning is displayed once per session. 
值得一提的是,调用代码如下所示

  df = convertCallCountsToHashTable(call_counts_hash_table )

  df %>%
    filter(needs_review) %>%
    filter( package != "R_GlobalEnv") %>%
    top_n( num_functions, desc(review_timer ))
我知道convertCallCountsToHashTable中的代码从未直接调用list\u len;然而,它确实调用了dplyr、tidyr和lubridate中的一些方法

我如何做类似于回溯的事情来找出此警告消息的来源

如何使警告在每个会话中显示不止一次,以便我可以尝试调试它?

您可以调试列表,然后使用sys.calls查看函数堆栈。请注意,由于没有导出列表,因此必须引用名称空间

my_fun <- function() rlang::list_len(3)
debug(rlang::list_len)
my_fun()
debugging in: rlang::list_len(3)
debug: {
    signal_soft_deprecated(paste_line("`list_len()` is soft-deprecated as of rlang 0.2.0.", 
        "Please use `new_list()` instead"))
    new_list(.n)
}
Browse[2]> sys.calls()
[[1]]
my_fun()

[[2]]
rlang::list_len(3)