Let's start with the basics. If you're reading a csv use read.csv. Using read.table won't actually split things correctly. I'm not really sure it will fix the exact problem you're dealing with but it's a start and will help avoid issues down the line. So can you do that and see how that works?