Question: (Closed) R: Error In Scan ... Line 7 Did Not Have 3 Elements
0
gravatar for silkeverhelle
5.4 years ago by
silkeverhelle10 wrote:

Hi, i'm trying to normalize my data but i get the following error:

celfiles <- read.affy(covdesc="silke.txt", path="data")
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : 
  line 7 did not have 3 elements

my txt file seems to be normal. I already searched for answers, but i don't know where i made a mistake

Thanks!!

R affymetrix • 17k views
ADD COMMENTlink modified 2.1 years ago by rwang09010 • written 5.4 years ago by silkeverhelle10
3

Hi Silke, please follow the guidelines for submitting an error in R:

  • post the output of traceback()
  • post a reproducible example (silke.txt, it is most likely the source of error)
  • post the output of sessionInfo()

Thanx!

ADD REPLYlink modified 5.4 years ago • written 5.4 years ago by Michael Dondrup46k
2

This error means what it says; the text file is not (tab) delimited in the way that you think. Most often this happens when lines contain comment characters (#) or single quotes. Read the help page for read.table() for ways to deal with this.

ADD REPLYlink written 5.4 years ago by Neilfws48k

I found a solution. Thanks for your reactions

ADD REPLYlink written 5.4 years ago by silkeverhelle10
4

Please, post your solution.

ADD REPLYlink written 5.4 years ago by zx87547.1k
2

Yes, please do. The point of this site is to provide answers for everyone. This post is not an answer.

ADD REPLYlink modified 5.4 years ago • written 5.4 years ago by Neilfws48k

Hello silkeverhelle!

We believe that this post does not fit the main topic of this site.

No longer relevant.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

ADD REPLYlink written 2.1 years ago by Michael Dondrup46k
0
gravatar for rwang0901
2.1 years ago by
rwang09010
rwang09010 wrote:

Here are the solutions:

You could have also set read.table(..., comment.char = "") to turn off the interpretation of comments in the file.
Apostrophies can also cause it ( ' ). Fix this by setting the option quote = "\""

from Rich Scriven .

ADD COMMENTlink written 2.1 years ago by rwang09010

Sometimes I also find it helpful to force the read with 'fill = T'. eg: read.table(..., comment.char = "", fill=T) Then I look at the resulting table to see which lines are tripping it up. Often times it's comments as those above have pointed out, or not designating the header/colnames propoerly. .

ADD REPLYlink written 2.1 years ago by Jake Warner690
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1273 users visited in the last hour