read.csv invalid multibyte string

Hello everyone,

I manage to overcome my error during the reading of the csv file by using <<library(readr)>>. When I review the data frame seems that a symbol of "µ" in some of the columns is the error. My question is: Is it possible to overcome this by for example deleting this symbol from every column? Or is it possible to change the symbol for another readable character?

Thanks!

Hi,

This issue likely stems from a file encoding issue. I'm pretty sure the issue would disappear if you convert the encoding to UTF-8. If you don't know how to convert a file to UTF-8, you can just follow these steps in Windows:

1. Find the file.
2. Right click on the file | click Open With.
3. Click Notepad.
4. Click File | then Save As.
5. Navigate to the folder where you want to save your file.
6. Provide a name for your file.
7. Add .csv to the end of the file.
8. Make sure that the encoding is set to UTF-8.
9. Click Save.
10. Open the newly created file.
11. Make sure that everything is correct

Hope this helps,
PJ

Thanks!
This seems to work.
Also in case anyone might need there is a package to clean non UTF-8 symbols from a data frame:

library(janitor)
df <- clean.names(df)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.