Error in read.table in R -


this question has answer here:

i have txt file 59.6kb. , write scripts did thousand times

cancer<-read.table("cancergenes.txt", row.names=1,header=t) 

and gives me error message:

error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :    line 1 did not have 28 elements 

what went wrong??!!

try using table(count.fields( ... ) strategy:

table(count.fields("yourpath/filename.txt", sep="", stringsasfactors=false,        allowescapes = true, quote="", comment.char="")) 

then add values 'quote' or 'comment.char' if needed. default values 'quote' 2 character string "'\"" , may want first try quote="\"" keep names single quotes (like "o'malley") causing problems , , default comment.char octothorpe, "#". mismatched quotes common in unclean data files , may need further investigation print out lines abnormal numbers of elements.

posting link location can examine file next step you.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -