R Warning message: In scan embedded nul(s) found in input (2 Examples)

This article explains how to deal with the “Warning message: In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : embedded nul(s) found in input” in the R programming language.

Example 1: Replicating the Warning Message – embedded nul(s) found in input

read.csv("some_df.csv") # read.csv function leads to warning
# Warning message:
#   In scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : embedded nul(s) found in input

Example 2: Solving the Warning Message – embedded nul(s) found in input

read.csv("some_df.csv", fileEncoding = "UTF-16LE") # Using proper fileEncoding

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top