Skip to content
Back to formatted view

Raw Message

Message-ID: <427B8F6C.3010704@statistik.uni-dortmund.de>
Date: 2005-05-06T15:38:20Z
From: Uwe Ligges
Subject: Percent (%) format in barplot
In-Reply-To: <BAY104-F1F1F409FA1AAA45B98E47AF1B0@phx.gbl>

Neuro LeSuperH??ros wrote:

> Percent format in barplot
> 
> Hello,
> 
> In a barplot, I need:
> 
> 1-The xaxis labels to be in percent format with one decimal. Example: 1.5%
> 
> barplot(height, horiz = TRUE, names=as.character(data$name))
> 
> 2- The data labels to be in the same format (percent format with one 
> decimal)
> 
> text(x,y,as.character(x),pos=4)
> 
> How do I do that?


What about

   paste(formatC(x, 1, format="f"), "%", sep="")

given x is scaled in percent, of course.


Uwe Ligges



> Thanks
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html