I'm learning R for my new job and I'm having trouble getting past this error. The code works for my coworkers but on my end I'm getting "more columns than column names." I am on a MacBook while they are on PCs. No idea how to proceed!
here's the code:
#practice.script.1# #4/21/20#
rm(list=ls()) #clears all variables from environment -->
graphics.off() #clears all plots/figs -->
It is not clear from the question when you get the error message - do you get it when you try to call write.table()? If so, we need more information on what you are trying to write: usually this error comes up because there is something not quite right with the separator.
It's difficult to figure out what is wrong exactly since I cannot see your data, but it seems that the header is potentially read as one column, so there might be something wrong with the separator. Open the file you are trying to load in a text editing program to check that the separators are really commas; both for your header and your data. Does read.csv() work?