[R] Odp: importing csv gets me all 16,000 columns with "NA"

Petr PIKAL petr.pikal at precheza.cz
Fri Oct 22 09:25:42 CEST 2010


You did not provide much info for help. What is size of imported file 

r-help-bounces at r-project.org napsal dne 22.10.2010 01:23:03:

> I'm new to R. I have a mac (OS10.6). I have converted an Excel file to a 
> to import into R. I have used many methods to import the file, most do 
> work, the best so far is:
> filename <- read.csv(/Users/Desktop/csvfile.csv", header=T, sep=","). I 
> also tried taking out the header and sep lines and it still imports 

Imports fine or not?

> Regardless of what I do, it always brings in the data but also includes 
> 16,000+ columns from Excel with X.1 as the first column up to X.16345 
> instance). Of course the files are filled with "NA" since no data is
> present.

It seems that this file have no header or the header are numbers from 1 to 

> How do I get around this?
> So far I have included strip.white=T and fill=T, something I've seen in
> other csv import posts but this does not work.

There are many ways how to import whole file by read.* commands but you 
could also check scan or readLines functions. The result always depends on 
looklike of your input file (separators, decimals, missing values etc.)


> Thanks!
> -- 
> View this message in context: 
> gets-me-all-16-000-columns-with-NA-tp3006480p3006480.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list