我已经成功使用下面的代码很长一段时间了,但由于某种原因现在它被破坏了。虽然我已经加载了和以前一样的包。同时,R 或 dplyr 版本没有变化。
看起来 dplyr 的 top_n() 函数不再适用于管道。
请问有人有解决此错误消息的经验吗?非常感谢任何帮助或提示。
R:3.6.1;dplyr:0.8.3
df %>% group_by(ID) %>% top_n(1,MRP)
追溯:
Error in as.list(x) : trying to get slot "matsin" from an object (class "quosures") that is not an S4 object
20.
as.list(x)
19.
splice(dot_call(capture_dots, frame_env = frame_env, named = named, ignore_empty = ignore_empty, unquote_names = unquote_names, homonyms = homonyms, check_assign = check_assign))
18.
FUN(X[[i]], ...)
17.
lapply(.x, .f, ...)
16.
map(syms, function(sym) { if (!is_symbol(sym)) { abort("Inputs to capture must be argument names") } ...
15.
endots(call = sys.call(), frame_env = parent.frame(), capture_arg = rlang_enquo, capture_dots = rlang_quos_interp, named = .named, ignore_empty = .ignore_empty, unquote_names = .unquote_names, homonyms = .homonyms, check_assign = .check_assign)
14.
enquos(...)
13.
quo_reduce(..., .op = op)
12.
all_exprs(!!!dots, .vectorised = TRUE)
11.
filter.tbl_df(x, top_n_rank({ { n } ...
10.
filter(x, top_n_rank({ { n } ...
9.
top_n(., 1, MRP)
8.
function_list[[k]](value)
7.
withVisible(function_list[[k]](value))
6.
freduce(value, `_function_list`)
5.
`_fseq`(`_lhs`)
4.
eval(quote(`_fseq`(`_lhs`)), env, env)
3.
eval(quote(`_fseq`(`_lhs`)), env, env)
2.
withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
1.
df %>% group_by(ID) %>% top_n(1,MRP)