Text in barplot in R
问题 I have a problem when adding values in a barplot in R. The problem is that I cannot place the values in the middle of each bar balance<- c(-4.3963714,0.2335795,-0.2777250,-2.0037130,-1.2526801, -6.4556516) barnames<-c("E1","E11","E12","E5","E7","E9") barplot(balance,ylim=c(-8,2),col=c(if ((balance[1])>0) "blue" else "red",(if ((balance[2])>0) "blue" else "red"),(if ((balance[3])>0) "blue" else "red"), (if ((balance[4])>0) "blue" else "red"),(if ((balance[5])>0) "blue" else "red"), (if (