When you typed something incorrect like the following, R gave you a cryptic error message rather than telling you “You forgot to put commas between the numbers.”
> x<-c(3 4 5)
Error: unexpected numeric constant in "x<-c(3 4"
This happens because R is looking for things to be right, not wrong. It keeps going as long as it can find anything that makes sense, and only gives you an error message when it can’t proceed further. Think about the times you have buttoned your shirt wrong. As long as you have a button to match the buttonhole, you keep going. You don’t notice the error until you get to the bottom and you have one button too many or too few. (And, of course, the problem really started higher up on the shirt, didn’t it?!)
When R saw the blank after the 3, it kept on going; after all, you could have a blank before a comma. When it hit the 4, R said “wait a minute. I can’t have another number (numeric constant) here,” so it gave you that error message.
When R gives you an error, remember that it may have passed the point where the real error happened; it keeps “buttoning the shirt” as long as it can. The error R gives will tell you why it can’t continue, which is not necessarily the cause of the problem.