Error in read.table in R -
this question has answer here:
- error in reading in data set in r 7 answers
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
Post a Comment