Foundations of R and Spatial Data