[R] Data Labels in a barchart (Lattice or otherwise)

David Winsemius dwinsemius at comcast.net
Mon Jul 5 16:20:42 CEST 2010


On Jul 4, 2010, at 11:43 PM, RaoulD wrote:

>
> Hi,
>
> Can anyone please help me with how I could add labels with the value  
> for
> each bar in a barchart? (similar to how data labels can be added in  
> Excel) I
> have done a lot of searching but havent been lucky.

This is generally pretty easy with text() at least if you are using  
base graphics. If it is not clear after reading the help page then  
post an examply with whatever barchart function you have chosen to  
use. If it's the lattice barchart there is an ltext example  
immediately before the barchart example that quickly can be grafted  
into the barchart code.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list