[R] sink file type and Latex (Lyx)

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 12 14:02:41 CEST 2008


On Fri, 12 Sep 2008, Joanne Demmler wrote:

> Does anyone know what file type sink is outputting to?

To be pedantic, whatever the connection you diverted to is using.  For a 
default file() connection, this is a plain text file in the encoding of 
the current locale.

> I've been reverting output from R using sink and wanted to add it to my 
> Appendix in LaTex (Lyx) using "Verbatiminput". However, I get an error 
> message as LaTex is expecting an ASCII file.
>
> Can I set sink somehow to ASCII or is there another option?

If your R code outputs ASCII, the sink() file will be ASCII.  Without 
knowing your OS or locale (hint, see the 'at a minimum' information 
required in the posting guide) it is very difficult to help here.

One possibility is that you need to set options(useFancyQuotes=FALSE), 
since if that is true it may use non-ASCII characters.  Another is that 
you are in a UTF-8 locale and have not told LaTeX so.  But really we can 
only guess.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list