[R] percentage in R

Roland Rau roland.rproject at gmail.com
Thu Jun 21 23:05:02 CEST 2007


genomenet at gmail.com wrote:
> Hi There,
> 
> How to display a number in the formation of percentage?
> 
> For example, a=0.25, how to display 25%?

if you write 'how to display' I guess you mean in a plot?

a <- 0.25
plot(0:10, 0:10, type="n")
text(x=5, y=5, labels=paste(round(a*100,0), "%", sep=""))

does this help?
Roland



More information about the R-help mailing list