上传有问题,重新发
> options(digits=2)
> a=c(Goodcon$INJ_SEV)
> b=table(a)
> b1=as.vector(b)
> c=prop.table(table(a))
> c1=as.vector(c)
> g=data.frame(b1,c1)
> dimnames(g)=list(c('0','1','2','3','4'),c("Frequency","Ratio"))
> x<-barplot(g$Ratio,font.lab=2,main="Good Condition",xlab="Injury Severity",ylab="Ratio",
+ xlim=c(0,6),ylim=c(0,0.7),names.arg=c("0","1","2","3","4"))
> gR<-paste(" ",g$Ratio)
> text(x,g$Ratio,labels=gR,cex=1.5,pos=3)