4

I need to enter non-english text data into R, but symbols åäöü gets substituted with wierd symbols like †.

Does R support reading character strings from alternative alphabets?

dimo414
  • 47,227
  • 18
  • 148
  • 244
Simon
  • 621
  • 4
  • 21
  • [Unicode](https://cran.r-project.org/web/packages/Unicode/Unicode.pdf) package for R should help you. – Shawn Mehan Aug 08 '15 at 17:18
  • 6
    If I type `x <- c("åäöü")` my R does not convert letters to weird symbols. Maybe it is a matter of encoding. What does `Sys.getlocale()` gives to you? – SabDeM Aug 08 '15 at 17:19

1 Answers1

1

R has support for Unicode. RStudio not picking the encoding I'm telling it to use when reading a file

Set your preferences in RStudio using the instructions from the link above.

Functions like read.csv and readLines have encoding options where you can specify something like "UTF-8".

iconv also exists to convert between encodings. There is also an extensive stringi library dedicated to string manipulation.

Community
  • 1
  • 1
CinchBlue
  • 6,046
  • 1
  • 27
  • 58