It's fine to answer your own question, but please make the answer more extensive so future users that find the thread may benefit. For instance, post the code that finally worked, and ideally an explanation of the issue/resolution.
To 'close' the question you can accept your own answer.

Please see How to add images to a Biostars post to embed images properly and please use the format bar to highlight code. This improves the readability and makes your post visually more appealing, motivating people to help you. I've done the changes for you this time.
As for your question, please show a few lines of the data. This is not strictly bioinformatics, but rather a general R question, so I cannot guarantee you that the question is not going to be closed by any of the other moderators.
thank you, as i have just figured out the answer, should i close this question?
As jrj.healey, it would be helpful for others if you provide an explanation what the issue was and how you solved it.