Re: [R] Output to connections

About this list Date view Thread view Subject view Author view Attachment view

From: Adelchi Azzalini (azzalini@stat.unipd.it)
Date: Tue 20 May 2003 - 21:27:25 EST


Message-id: <20030520112726.205437CA824@tango.stat.unipd.it>

On Tuesday 20 May 2003 13:03, Henrik Bengtsson wrote:
> In R '\' has to be escaped, i.e. '\\' which means '\\' has to be '\\\\'
> (this was probably there before the help page was generated!?)
>
> The following works
>
>   ## convert decimal point to comma in output, using a pipe (Unix)
>   zz <- pipe(paste("sed s/\\\\./,/ >", "outfile"), "w")
>   cat(format(round(rnorm(100), 4)), sep = "\n", file = zz)
>   close(zz)
>   ## now look at the output file:
>   file.show("outfile", delete.file = TRUE)

Yes, it works, thanks

Adelchi

-- 
Adelchi Azzalini  <azzalini@stat.unipd.it>
Dipart.Scienze Statistiche, Università di Padova, Italia
http://azzalini.stat.unipd.it/

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:50 EST