3

I cannot import the following cities: Genève Bülach etc..

I have tried the solutions on Stackoverflow but nothing seems to work. Do you have something that worked for you?

Thank you.

ArbenK
  • 63
  • 1
  • 5
  • 4
    Hey ArbenK, welcome to the community. You need to provide us at least some code and the output. Furthermore, an example or the file would be perfect. – Stephan Oct 20 '18 at 18:45
  • 1
    Please show us the R commands you're using to read the file. – Caleb Oct 20 '18 at 18:50
  • 1
    Did you look at [Cannot read unicode .csv into R](https://stackoverflow.com/q/16838613/4752675) ? – G5W Oct 20 '18 at 18:54
  • 1
    This might be an encoding problem. Maybe you could try to add `options(encoding = "utf-8")` in your .Rprofile file or you could make sure that the locale on your machine are set to utf-8 – prosoitos Oct 20 '18 at 19:10

2 Answers2

2

Try importing your file specifying the encoding to encoding = "UTF-8" in the read.csv function.

For example, data <- read.csv("your_file.csv", encoding = "UTF-8").

Trex
  • 529
  • 3
  • 11
0

Try this other Stackoverflow thread where the OP first tries to guess the encoding by using guess_encoding("you file name here") (from readr package). Then instead of writing encoding= "[whatever it gives you]" in your read.csv statement, try fileEncoding = "[whatever it gives you]".

Incidentally for me, having "é" and "è", it gave me "ISO-8859-1" and I was able to import the data with the correct accented characters.

lokxs
  • 171
  • 10