我有一个这样的数据框-
df = data.frame(recall=c(0.55,0.62,0.43,0.61,0.19,0.14,0,0.19,0.33,0.33,0,0.33),
type= c("Phone numbers","Phone numbers","Phone numbers","Phone numbers","Emails","Emails","Emails","Emails","URLs","URLs","URLs","URLs"),
model=c("Cognition","TS-SAR","TS-ABINet","TS-RobustScanner",
"Cognition","TS-SAR","TS-ABINet","TS-RobustScanner",
"Cognition","TS-SAR","TS-ABINet","TS-RobustScanner"),
lb=c(0.47,0.55,0.35,0.53,
0.07,0.04,0,0.07,
0.14,0.14,0,0.14),
ub=c(0.63,0.7,0.51,0.69,
0.30,0.24,0,0.3,
0.52,0.52,0,0.52))
它由4个“图像中的文本检测”ML模型的结果组成。这个
recall
列具有每个模型的召回度量值,基于
type
检测到的文本数(电话号码、电子邮件或URL)。这个
ub
和
lb
列具有95%置信区间的召回下限值。
我想用R把它绘制成一个图。
ggplot2
pd <- position_dodge(width=0.2)
ggplot(df, aes(model,recall, color=type)) +
geom_point(aes(shape=type),size=4, position=pd) +
scale_color_manual(name="Type",values=c("coral","steelblue")) +
scale_shape_manual(name="Type",values=c(17,19)) +
theme_bw() +
scale_x_continuous("Model", breaks=1:length(model), labels=model) +
scale_y_continuous("Recall values") +
geom_errorbar(aes(ymin=lb,ymax=ub),width=0.1,position=pd)
然而,这给了我一条错误消息
check\u breaks\u labels(breaks,labels)中出错:找不到对象“model”
你知道为什么这可能是个错误吗?此外,如果有人有任何建议,我也愿意接受绘制这些数据的新方法。谢谢