[R] Sweave encoding option

Shi, Tao shidaxia at yahoo.com
Wed Sep 5 02:02:25 CEST 2012



Hi list,

I was running Sweave on one of my .rnw file.  Everything was fine, until I came back from the vacation.  Nothing changed (at least to my knowledge), but now I have this problem:

>     Sweave("myfile.rnw")
Error: ‘COLO001final.rnw’ is not ASCII and does not declare an encoding


After snooping around on the web, I found this solution:

> Sweave("myfile.rnw", encoding="utf8")

Now everything works fine.

Could somebody explain to me what happened?  Why I need to specify the "encoding" now for it to work?  What has changed (beyond my knowledge) in my computer that is causing this error?

I'm running R 2.15.1 on WinXP.

Thanks!

Tao



More information about the R-help mailing list