我正在尝试为几个交叉表绘制具有几率的发布就绪图。为此,我还想包括赔率的值以及观察到的次数。由于某种原因,我的geom_text被复制了(见下文):
这是相应的代码:
p1 <- ggplot(odd, aes(odds.ratio, fct_rev(names)))
p1<-p1+geom_vline(aes(xintercept = 1), size = .25, linetype = 'dashed') +
geom_errorbarh(aes(xmax =ifelse(upr.ci<13,upr.ci,13), xmin = lwr.ci), size = .5, height =.2, color = 'gray50') +
geom_point(size = 5, color = 'orange') +
geom_text(aes(label=paste(round(odds.ratio,2),sep =" ","(n=",n,")")), size = 3,color='gray50')+
ylab('D') +
xlab('Odds ratio')+
ggtitle('R')
有人知道如何解决该问题吗?