I am using knitr 1.1. in R 3.0.0 and in WinEdt (RWinEdt 2.0). I have problems with a knit that recognizes Swedish characters (ä, ö, å). This is not a problem with R; these characters are even recognized in file names, directory names, objects, etc. In Sweave, this is not a problem either.
I already have \usepackage[utf8]{inputenc} in my document, but knitr doesn't seem to be able to handle special characters. After starting knitr, I get the following message:
Warning in remind_sweave(if (in.file) input) : It seems you are using the Sweave-specific syntax; you may need Sweave2knitr("deskriptiv 130409.Rnw") to convert it to knitr processing file: deskriptiv 130409.Rnw (*) NOTE: I saw chunk options "label=läser_in_data" please go to http://yihui.name/knitr/options (it is likely that you forgot to quote "character" options) Error in parse(text = str_c("alist(", quote_label(params), ")"), srcfile = NULL) : 1:15: unexpected input 1: alist(label=lä ^ Calls: knit ... parse_params -> withCallingHandlers -> eval -> parse Execution halted
The specific label he complains about is label = läser. Changing the label is not enough, because knitr even complains if R objects use äåö.
I used Sweave2knitr () since the file was created for Sweave, but the result was no better: now all åå were converted to äpà ¥ ö, both in R fragments and in latex text, and knitr is still gives an error message.
Session Information:
R version 3.0.0 (2013-04-03) Platform: i386-w64-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Swedish_Sweden.1252 LC_CTYPE=Swedish_Sweden.1252 LC_MONETARY=Swedish_Sweden.1252 [4] LC_NUMERIC=C LC_TIME=Swedish_Sweden.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] knitr_1.1 loaded via a namespace (and not attached): [1] digest_0.6.3 evaluate_0.4.3 formatR_0.7 stringr_0.6.2 tools_3.0.0
As I already mentioned, there are file names and objects with Swedish characters (since this was not a problem before), and the text should also be in Swedish.
Thank you for your help in making knitr work outside of English.
user2266041
source share