An Introduction To R For Clinician Developers
I am not the best person to teach you R as I love Python, however these code snippets can give you the general idea.
Finding good resources to learn R can be a bit tricky. There are good courses on Udemy and Udacity. www.Datacamp.com is an excellent resource but not cheap.
Coursera has a good course on it too.
However, I have to be honest, if you want to learn R www.Datacamp.com is hard to beat!
If I was into it that's where I would go as they cover it very thoroughly and also cover SQL which will be the next language you will need to learn.
But, if you are not programming in an academic/R environment can I suggest you please just learn Python first ;) it will make your life much simpler later on :)
Matt