[R] Sweave and uttf-8 under Windows XP

Sven Garbade sfgarbade at googlemail.com
Thu May 20 12:21:50 CEST 2010


Great, thanks, Sveb

2010/5/20 Duncan Murdoch <murdoch.duncan at gmail.com>:
> Sven Garbade wrote:
>>
>> Hi list,
>>
>> I need to process a Rnw file and and a csv file (both are encoded in
>> UTF-8) under Windows XP  (R Version 2.11.0, i386, mingw32).
>>
>
> Take a look at this post:
>
> http://tolstoy.newcastle.edu.au/R/e10/help/10/05/4889.html
>
> which discussed this issue recently.
>
> Duncan Murdoch
>>
>> I can source and run the Rnw file:
>>
>>
>>>
>>> Stangle("Bericht.Rnw")
>>>
>>
>> Writing to file Bericht.R
>>
>>>
>>> source(file("Bericht.R", encoding="UTF-8"))
>>>
>>
>> which runs fine, but running Sweave() failed:
>>
>>
>>>
>>> Sweave("Bericht.Rnw")
>>>
>>
>> Writing to file Bericht.tex
>> Processing code chunks ...
>>  1 : term verbatim
>>  2 : term verbatim
>>
>> Fehler:  chunk 2
>> Error in parse(text = chunk) : Unerwartetes Eingabe in:
>> "
>> data$X6.1.Staats.angehö"
>>
>> My first idea was to run Sweave like Sweave(file("Bericht.Rnw",
>> encoding="UTF-8")), but Sweave seems to expect a file name as a
>> character rather a connection. The Rnw and csv file were created under
>> Linux in a UTF-8 locale and were further processed by xelatex.
>>
>> Are there any ideas to get Sweave working? I would be nice when the
>> file encoding can be left in UTF-8.
>>
>> Thanks, Sven
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>



More information about the R-help mailing list