From sokol at insa-toulouse.fr  Fri Mar 16 17:19:13 2018
From: sokol at insa-toulouse.fr (Serguei Sokol)
Date: Fri, 16 Mar 2018 17:19:13 +0100
Subject: [Rd] cat(fill=N)
In-Reply-To: <CAARY7ki-sZKdhFaknTh5pDOWTLumw==RiVs0Wi2BDGkOSLUuhA@mail.gmail.com>
References: <CAARY7ki-sZKdhFaknTh5pDOWTLumw==RiVs0Wi2BDGkOSLUuhA@mail.gmail.com>
Message-ID: <d18f4888-7279-580c-ec50-f59b49c59418@insa-toulouse.fr>

Le 16/03/2018 ? 17:10, David Hugh-Jones a ?crit?:
> Hi all,
>
> I expect I'm getting something wrong, but
>
> cat("foo bar baz foo bar baz foo bar baz", fill = 10)
>
> should be broken into lines of width 10, whereas I get:
>
>> cat("foo bar baz foo bar baz foo bar baz", fill = 10)
> foo bar baz foo bar baz foo bar baz
On the other side, if I do
 > cat(strsplit("foo bar baz foo bar baz foo bar baz", " ")[[1]], fill = 10)
I get the expected result:

foo bar
baz foo
bar baz
foo bar
baz

Which suggest that cat() doesn't break elements of submitted character vector
put put enough of them to fill the requested width.

Serguei.

>
> This is on R 3.4.3, but I don't see mentions of it fixed in 3.4.4 or
> r-devel NEWS.
>
> Cheers,
> David
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] cat(fill=N)
Serguei Sokol