Backtrace: ▆ 1. ├─base (local) `<fn>`(x) 2. └─ggplot2:::print.ggplot(x) 3. ├─ggplot2::ggplot_build(x) 4. └─ggplot2:::ggplot_build.ggplot(x) 5. └─ggplot2:::by_layer(...) 6. ├─rlang::try_fetch(...) 7. │ ├─base::tryCatch(...) 8. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers) 9. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]]) 10. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler) 11. │ └─base::withCallingHandlers(...) 12. └─ggplot2 (local) f(l = layers[[i]], d = data[[i]]) 13. └─l$compute_aesthetics(d, plot) 14. └─ggplot2 (local) compute_aesthetics(..., self = self) 15. └─ggplot2:::scales_add_defaults(...) 16. └─base::lapply(aesthetics[new_aesthetics], eval_tidy, data = data) 17. └─rlang (local) FUN(X[[i]], ...) Run rlang::last_trace(drop = FALSE) to see 5 hidden frames. >
时间: 2024-04-26 11:20:22 浏览: 10
这是R语言中的错误信息,其中包含了函数调用的堆栈(backtrace),可以帮助我们定位代码中的错误。根据堆栈信息,可以看到错误发生在第13行,即调用了compute_aesthetics()函数,并且该函数的一个参数data中可能包含了不存在的变量。可以使用rlang::last_trace()函数来查看具体的错误位置和原因,然后修复代码中的错误即可。提示:在使用last_trace()函数时,可以加上参数drop=FALSE,这样会显示所有的堆栈信息。
相关问题
Backtrace: ▆ 1. ├─pred_lm %>% roc_auc(truth = 是否发生, .pred_pass) 2. ├─yardstick::roc_auc(., truth = 是否发生, .pred_pass) 3. └─yardstick:::roc_auc.data.frame(., truth = 是否发生, .pred_pass) Run rlang::last_trace(drop = FALSE) to see 20 hidden frames.
这个Backtrace显示在运行`roc_auc()`函数时,代码中使用了`pred_lm`作为输入,但是在`roc_auc()`函数中没有正确指定`.pred_pass`列。这可能是因为在`pred_lm`中并没有包含`.pred_pass`列,或者是因为在调用`roc_auc()`函数时,没有正确指定`.pred_pass`列。
您可以尝试检查一下`pred_lm`数据框中是否包含`.pred_pass`列,并且检查一下是否正确指定了`.pred_pass`列。另外,您也可以尝试在`roc_auc()`函数中使用正确的列名。
Error in `mutate()`: ℹ In argument: `colour = case_when(...)`. Caused by error in `case_when()`: ! could not find function "case_when" --- Backtrace: ▆ 1. ├─pca.result %>% ... 2. ├─dplyr::mutate(...) 3. └─dplyr:::mutate.data.frame(...) 4. └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by) 5. ├─base::withCallingHandlers(...) 6. └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns) 7. └─mask$eval_all_mutate(quo) 8. └─dplyr (local) eval() Run rlang::last_trace(drop = FALSE) to see 3 hidden frames.
这是一个R语言的错误提示,提示在mutate()函数中传递给color参数的case_when()函数出现了问题。错误可能是由于R包版本不兼容或语法错误引起的。您可以使用rlang::last_trace(drop = FALSE)函数查看错误的详细信息,以确定问题的确切原因。其中的Backtrace信息可以展示函数的调用过程,可能有助于查找问题所在。