I'm having issues preparing an rmarkdown document in RStudio.
I'm importing a German data set that includes the umlaut "ü". When reading the table into RStudio I have to include the umlaut in a string.
The document is produced without any issues aside from the fact that after the ü, the text becomes the inverse of the color it should be. I created a MWE that reproduces the problem.
In the MWE the first chunk renders as I expect, however in the second chunk, after the word 'lücky' the remaining string elements are black.
Is there a way to avoid this?
---
output: pdf_document
---
## MWE
When I use a normal 'u' in lucky everything looks fine
```{r }
a <- c('dog', 'cat', 'rabbit', 'lucky', 'pig', 'sheep', 'goat')
```
When I use a German 'ü' in lucky, the green text is the inverse of as it should be
```{r }
a <- c('dog', 'cat', 'rabbit', 'lücky', 'pig', 'sheep', 'goat')
```
Update with sessionInfo()
and options('encoding')
:
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.1 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2 htmltools_0.3.6
[6] tools_3.5.1 yaml_2.2.0 Rcpp_0.12.18 stringi_1.2.4 rmarkdown_1.10
[11] knitr_1.20 stringr_1.3.1 digest_0.6.16 evaluate_0.11
> options('encoding')
$`encoding`
[1] "native.enc"