Introduction to R and RStudio
Chapter 17 Further reading
There is a myriad of websites/books on programming in R. These may provide an excellent start:
The Introduction to R compiled by Robert Hijmans provides a good start. It is in fact a subset of the Spatial Data Science with R portal, which provides excellent information on spatial analyses for ecological studies in R.
The book Hands-On Programming with R by Garrett Grolemund also gives a very good introduction to R, especially parts 1 and 2.
The book R for Data Science by Hadley Wickham and Garrett Grolemund is a key book when it comes to conducting data science using R. It introduces the tidyverse, a collection of R packages designed to work together to make data science fast, fluent, and fun.