В общем посмотрел в Интернете на форумах. Всё уже перепробовал. И кодировку менять. Но ошибки не исправляются.
Помогите пожалуйста понять что не так. Ниже привожу коды различных вариантов.
> a <- read.csv(file = "air.csv", header = TRUE)
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 4 appears to contain embedded nulls
3: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'air.csv'
> a<-read.table(file = "air.csv", header = TRUE, sep = ",")
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 1 did not have 2 elements
In addition: Warning messages:
1: In read.table(file = "air.csv", header = TRUE, sep = ",") :
line 1 appears to contain embedded nulls
2: In read.table(file = "air.csv", header = TRUE, sep = ",") :
line 4 appears to contain embedded nulls
3: In read.table(file = "air.csv", header = TRUE, sep = ",") :
incomplete final line found by readTableHeader on 'air.csv'
> a = read.csv(file = "air.csv",header = TRUE)
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 4 appears to contain embedded nulls
3: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'air.csv'
> a <- read.csv("air.csv", sep = ",", fileEncoding = "utf-16")
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'air.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'air.csv'
> Sys.getlocale()
[1] "LC_COLLATE=Russian_Russia.1251;LC_CTYPE=Russian_Russia.1251;LC_MONETARY=Russian_Russia.1251;LC_NUMERIC=C;LC_TIME=Russian_Russia.1251"
> a <- read.csv("air.csv", fileEncoding = "UTF8")
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
invalid input found on input connection 'air.csv'
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
3: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'air.csv'
> library(readr)
Warning message:
пакет ‘readr’ был собран под R версии 3.2.5
> air <- read_csv("C:/air.csv", col_types = cols_only(`PK\003\004\024` = col_character()))
Warning: 5556 parsing failures.
row col expected actual
2 NA 1 columns 2 columns
3 PK embedded null
3 NA 1 columns 3 columns
7 PK embedded null
7 NA 1 columns 2 columns
... .............. ......... .............
See problems(...) for more details.
> View(air)
> a <- data.table(read.table(air.csv, header = FALSE, sep = ",",
+ comment.char = "", fill = TRUE, check.names = FALSE,
+ blank.lines.skip = TRUE))
Error: could not find function "data.table"
Mikhail01 Mikhail01, решилась проблема? если да, то как?
У меня точно тоже самое
Исходные данные в файле с кодировкой UTF-16, их нужно импортировать в R
Меняла параметры fileEncoding, colClasses и пр.
выдает ошибку "incomplete final line found by readTableHeader "
кусок файла: