Simple csv import error
1
0
Entering edit mode
@alexandria95ragsdale-20135
Last seen 5.1 years ago

Hello,

I'm relatively new to R. I'm just trying to import a csv file:

counts=read.csv("readcounts_use.csv", sep="", head=T, skip=1, row.names = "Geneid")

But I keep getting the error:

Error in data[[rowvar]] : 
  attempt to select less than one element in get1index

Not sure whats causing this or how to fix it.

Thanks! Alex

software error • 1.4k views
ADD COMMENT
1
Entering edit mode
swbarnes2 ★ 1.3k
@swbarnes2-14086
Last seen 18 minutes ago
San Diego

You need to look hard at all the elements in your command line, and figure out what each of them is doing.

Because the field separator in a csv is not white space. It's a comma.

And are you sure that you want to be both skipping a row and have a header row? I get that error if I put nonsense in the row.names part of the command, which suggest to me that you are asking the software to make a row names out of the top line, which you removed already with skip.

ADD COMMENT

Login before adding your answer.

Traffic: 1019 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6