[R] options()$width does not equal actual console width - why?

Mark Heckmann mark.heckmann at gmx.de
Fri Nov 26 17:32:54 CET 2010


I am writing a function that breaks the output if it gets bigger than the available console width.
I noticed that a right margin always remains. The following code shows that the actual console size
is always bigger than the one reported by options()$width. What might be the reason?
(Software: MacOS 10.6, R 2.12)

> cat(paste(rep(c(1:9, 0), each=10), collapse=""))
11111111112222222222333333333344444444445555
55555566666666667777777777888888888899999999
990000000000
> options()$width
[1] 46

> cat(paste(rep(c(1:9, 0), each=10), collapse=""))
11111111112222222222333333333344444444445555555555666666666677777
77777888888888899999999990000000000
> options()$width
[1] 59

Thanks 
Mark
–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com



More information about the R-help mailing list