Hello,
Since I could not really find a solution for my previous questions related to protein and complexes. I am trying to work on i
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
more columns than column names*
Is there anyone know how many columns I should expect from this input ? how to fix this problem?
As I saw in the linked file, it probably is not a csv file, but
";"
sep file. Maybe usingread.table
andquote=""
, andcomment.char = "", sep=";"
. Even you think it's a csv file, still addquote=""
, andcomment.char = ""
as they are the main reason ofmore columns than column names
.@Zhilong Jia your comments pushed me toward a good answer. when I remove the header from the file and I get it with data.table, the loaded file seems to be alright , however, I dont know why when I get it with header it is not working well . I liked your answer anyway, thanks
Check your .csv file in a text editor (gedit/notepad etc) to see if you have whitespace at the end of lines, or a missing header. That's often the problem in my experience.
@Daniel header should be fine, because it is a database. There is a problem with the rest that I don't know which section belongs to which header.
Your data has a semi-colon separator your actual data has lots of comas in it. Change your input line to this and it should work:
@Daniel thanks a good answer was given below which I accepted.
Your header is actually not comma separated. Do
head -1 allComplxes.csv
and check.If you doheader=FALSE,
it will load the data.@venu If you turn off the header, it will load it, but it does not make any sense. Please look at it. it mixed the IDs with names
I've only checked the header, didn't load into R. Edited. Open in google spreadsheet and you'll come to know how many fields are actually comma separated. Edit whole file with some bash commands then load it into R.