我已经成功地在同一个图中创建了一个包含不同预测模型的多条 ROC 曲线的图,并且 AUC 和 CI 的数值很好地印在了侧面。
然而,我的项目用三位小数打印这些是没有意义的,而是我需要带有两位小数的四舍五入版本,我无法说服 Rstudio 以这种方式打印它......
(为了澄清,它说AUC: 0.708 (0.661-0.754)
我需要它是 0.71(0.66-0.75))。
我试过:
print(ROC_rfhipfx60X1MOmospugholt, digits = max(3, getOption("digits") -3 ), call= TRUE)
返回调用(起初似乎成功):
Call:
roc.default(response = hipfx_pugely_and_holt_predictions_20200820$`1MO`, predictor = hipfx_pugely_and_holt_predictions_20200820$`PUGELY RISK %`, ci = TRUE, plot = TRUE, print.auc = TRUE, col = "red", lwd = 4, print.auc.y = 0.3, legacy.axes = TRUE, add = TRUE)
Data: hipfx_pugely_and_holt_predictions_20200820$`PUGELY RISK %` in 121 controls (hipfx_pugely_and_holt_predictions_20200820$`1MO` no) > 1050 cases (hipfx_pugely_and_holt_predictions_20200820$`1MO` yes).
Area under the curve: 0.7078
95% CI: 0.6615-0.7542 (DeLong)
>
而不是创建一个新的情节,它会返回(如果我滚动浏览我的情节并返回到不工作的情节,则会再次打印相同的消息):
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file '/var/folders/22/nxnj3khn76q9hz0khppd11_40000gn/T/RtmpXrawRS/rs-graphics-7de8e907-4a56-4944-b16e-aeb4054ee835/2473fad9-4618-46c1-9014-fbcb61050b97.snapshot', probable reason 'No such file or directory'
Graphics error: Plot rendering error
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection