Get "embedded nul(s) found in input" when reading a csv using read.csv()

r

Solution

Your CSV might be encoded in UTF-16. This isn't uncommon when working with some Windows-based tools.

You can try loading a UTF-16 CSV like this:

read.csv("mycsv.csv", ..., fileEncoding="UTF-16LE")

Problem

I was reading in a csv file. Code is: ``` mydata = read.csv("mycsv.csv", header=True, sep=",", quote="\"") ``` Get the following warning: Warning message: In `scan(file = file, what = what, sep = sep, quote = quote, dec = dec`, : embedded nul(s) found in input Now some cells in my CSV have missing values that are represented by "". How do I write this code so that I do not get the above warning?

Original source