Re: [R] strange (to me) ncolumns default value in 'write'

From: Martin Maechler <>
Date: Mon 05 Jun 2006 - 19:42:19 EST

>>>>> "AntonioF" == Antonio, Fabio Di Narzo <>
>>>>> on Sun, 4 Jun 2006 18:42:35 +0200 writes:

    AntonioF> Hi all.
    AntonioF> In 'write' documentation, one can read:

    AntonioF> write(x, file = "data",
    AntonioF>       ncolumns = if(is.character(x)) 1 else 5,
    AntonioF>       append = FALSE, sep = " ")

    AntonioF> Now my question is: why the default value of 1column for character vectors     AntonioF> and the special value '5' for non character vectors?

well, most of us have five fingers per hand, so many consider '5' to be a 'nice' number :-)
For R, the main reason of using this default, was that S already had it. And S has had it not only for the above reason, but I guess also because nicely, 5 * 16 = 80, and 80 used to be the customary terminal width in the 70s and 80s, i.e., the good old times S was created.

    AntonioF> Nice sunday to all,

and Pentecoste Monday, for those with an extra free day like me.

Martin Maechler, ETH Zurich

    AntonioF> Antonio, Fabio Di Narzo.

    AntonioF> Note: this is just curiosity. Don't read as: "WHY? WHY!?!?", but just as     AntonioF> "why?" mailing list PLEASE do read the posting guide! Received on Mon Jun 05 21:00:52 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 05 Jun 2006 - 22:10:29 EST.

Mailing list information is available at Please read the posting guide before posting to the list.