There are many resources online and in print. This is by no means a comprehensive list, but hopefully a launching pad for some very useful website and books. All of these examples provide code in same shape or form.
This is a list of most of the data sources used in this course.
sf
packageraster
tidyverse
purrr