Please start using markdown code tags when posting code and data samples - this can potentially improve traction of your threads.
Having said that... what have you tried so far(othen than R)?
I will absolutely start using the markdown tags. In regard to your question, I had looked up different websites and had trouble understanding how to revise the code to fit my needs. However, I found something that worked: