[R] Aligning text in the call to the text function

baptiste auguie baptiste.auguie at googlemail.com
Thu Apr 1 23:05:40 CEST 2010


Hi,

One option with Grid graphics,

m <-
matrix(c( 1667,    3,    459,
         2001, 45,   34,
         1996,   2,    5235),
       dimnames=list(c("Eric & Alan", "Alan","John & David")),
        ncol=3, byrow=T)

## install.packages("gridExtra", repos="http://R-Forge.R-project.org")
library(gridExtra)

grid.table(m, theme=theme.white(row.just="left",core.just="left"))

HTH,

baptiste

On 1 April 2010 21:39, Tighiouart, Hocine
<htighiouart at tuftsmedicalcenter.org> wrote:
> Hi,
>
> I have text (see below) that is aligned nicely when printed in the
> command window in R but when plotted using text function, it does not
> show alignment unless I use the family="mono" in the call to the text
> function. Is there a way to specify a different font while maintaining
> the alignment?
>
>  Eric & Alan 1667   3   459
>  Alan 2001          45  34
>  John & David 1996  2   5235
>
> Thanks for any hints
>
> Hocine
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list