Displaying 2 results from an estimated 2 matches for "nlsep".
1997 May 25
1
R-alpha: generic write()
...there is no function `code'.
* cat() is a bit inconsistent:
R> cat(x, sep = "&")
1&2&3&4R> cat(x, sep = "&\n")
1&
2&
3&
4
R>
Actually, a final newline is added whenever sep contains a newline.
>From src/main/builtin.c:
nlsep = 0;
for (i = 0; i < LENGTH(sepr); i++)
if (strstr(CHAR(STRING(sepr)[i]), "\n")) nlsep = 1;
...
if ((pwidth != INT_MAX) || nlsep)
Rprintf("\n");
I am not sure this is the right thing to do.
(In particular, it makes it rathe...
2008 Nov 05
2
puzzled by cat() behaviour when argument '...' is a vector (and argument 'sep' contains "\n")
...---------------------------------------------------------------
##### "\n"
I have looked a bit into the source code
(lines 468-630 in builtin.c in src/main)
and found out, as variable pwidth is set to 1 in line 504, i.e.;
if (strstr(CHAR(STRING_ELT(sepr, i)), "\n")) nlsep = 1; /* ASCII */
the code in lines 622-23, i.e.;
if ((pwidth != INT_MAX) || nlsep)
Rprintf("\n");
is responsible for the newline. Is this really intended?
##### separators, not terminators
Another look shows that, contrary to what is said in the help file,
an element of...