我刚刚更新了 dblyr,从那一刻起我开始看到警告
Warning messages: 1:
lang_name()
is deprecated as of rlang 0.2.0. Please usecall_name()
instead. This warning is displayed once per session. 2:lang()
is deprecated as of rlang 0.2.0. Please usecall2()
instead. This warning is displayed once per session.
我不知道我应该做什么,因为我的代码看起来像这样
df <- tbl(conn, in_schema("schema", "table")) %>%
filter(status!= "CLOSED" | is.na(status)) %>%
group_by(customer_id) %>%
filter(created == min(created, na.rm = T)) %>%
ungroup() %>%
select(
contract_number,
customer_id,
approved_date = created
) %>%
collect()
我的代码中没有 call_name() 或 lang_name() 。你们知道出了什么问题吗?我知道即使有此警告,我的代码也可以工作,但我不想看到它。
最佳答案
正如您已经提到的,没有任何问题,您的代码工作正常,因为这是一个警告。 dbplyr
中的窗口函数仍然使用 lang_name()
函数调用。窗口函数在 filter( ... == min(...))
语句中调用。 Github 上已经有一个针对此问题的问题 link 。
如果您不想看到警告,可以像这样抑制它:
suppressWarnings(df <- tbl(conn, in_schema("schema", "table")) %>%
filter(status!= "CLOSED" | is.na(status)) %>%
group_by(customer_id) %>%
filter(created == min(created, na.rm = T)) %>%
ungroup() %>%
select(
contract_number,
customer_id,
approved_date = created
) %>%
collect())
关于R - dbplyr - `lang_name()` 已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57977202/