I would like the text plotted with 'mtext' to be alighned like it is for
printing on the console. Here is what I have:

 

> print(emt)

                    ME                   RMSE                  MAE
MPE           MAPE         MASE

original -1.034568e+07 1.097695e+08 2.433160e+07 -31.30554   37.47713
1.5100050

xreg        1.561235e+01 2.008599e+03 9.089473e+02 267.05490 280.66734
0.9893643

 

> a <- capture.output(print(emt))

> a

[1] "                    ME         RMSE          MAE       MPE      MAPE
MASE"

[2] "original -1.034568e+07 1.097695e+08 2.433160e+07 -31.30554  37.47713
1.5100050"

[3] "xreg      1.561235e+01 2.008599e+03 9.089473e+02 267.05490 280.66734
0.9893643"

 

There are no tabs but when adding to a plot with mtext like:

 

op <- par(mfcol = c(2, 1), oma=c(0,0,4,0))

. . . . .

a <- capture.output(print(emt))

mtext(a[1], line= 1, side=3, outer=TRUE)

mtext(a[2], line= 0, side=3, outer=TRUE)

mtext(a[3], line=-1, side=3, outer=TRUE)

 

The plotted text is not aligned like when it is displayed on the console. I
have looked at the strings and they all have the same length so it seems
that mtext is doing something with the spaces so that the output is not
aligned. Any ideas on how I can get it aligned (by column)?

 

Thank you.

 

Kevin


	[[alternative HTML version deleted]]

