原标题:R语言答疑:txt文件无法被R正确读入
今天来解答一个网友的疑惑,或许你也曾遇到过这个问题噢~
R语言中,txt无法正确的读入的可能性有很多种。有位网友提供的一个无法正确读入的文本文件,使用记事本打开,看起来一切正确(见图片)。
但读入的时候,报错如下。
>read.table("1.txt")
Error intype.convert(data[], as.is = as.is, dec = dec, numerals = numerals, :
'<67>'多字节字符串有错
此外,Warning messages:
Inread.table("1.txt") : line 1 appears to contain embedded nulls
Inread.table("1.txt") : line 2 appears to contain embedded nulls
Inread.table("1.txt") : line 3 appears to contain embedded nulls
Inread.table("1.txt") : line 4 appears to contain embedded nulls
Inread.table("1.txt") : line 5 appears to contain embedded nulls
Inscan(file = file, what = what, sep = sep, quote = quote, dec = dec,:embedded nul(s) found in input
<