Read.delim () - errors "more columns than column names" and "header" and "col.names" have different lengths "

Preliminary OS information : Windows XP Professional Version 2002 Service Pack 3; R: R 2.12.2 (2011-02-25)

I am trying to read a column of 30,000 rows of 80 each, a tab delimited text file in R using a function read.delim(). This file has column headers with the following naming convention: "_". The code I use to try to read the data:

cc <- c("integer", "character", "integer", rep("character", 3), 
        rep("integer", 73))

example_data <- read.delim(file = 'C:/example.txt', row.names = FALSE,
                           col.names = TRUE, as.is = TRUE, colClasses = cc)

After sending this command, the following error message appears:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
more columns than column names
In addition: Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote,  :
  header and 'col.names' are of different lengths

Information that may be important - from column 8 to column 80, the number of zeros in each column is as follows:

column 08: 29,000 zeros
column 13: 15,000 zeros
column 19: 500 zeros
column 43: 15,000 zeros
columns 65-80: 29,000 zeros for each column

- , ? .

+5
3

col.names=TRUE. , , , , .

f , read.delim , header=TRUE; row.names=TRUE, , .

read.delim.

+6

, read.csv/read.csv2. , , , , .

+5

, .csv read.csv. , . .;

read.csv("filepath")
0

All Articles