I am using Windows 7, R2.15.3 and RStudio 0.97.320 with knitr knitr_1.1.6 (downloaded after Yihui fixed the \'Encoding: knitr and child files\' issue on March 12)
Ideally I should have an encoding
argument in read_chunk()
, but since you were using UTF-8
, this probably works:
read_chunk(lines = readLines("TestSpanishText.R", encoding = "UTF-8"))
Please try this first. If it does not work, I will add an encoding
argument. Anyway, I'm sure this definitely works (it is just slightly longer):
con = file("TestSpanishText.R", encoding = "UTF-8")
read_chunk(con)
close(con)