Try with the ASDAR book (go to chapter 8 if you're already familiar with spatial statistics):
http://www.gisarea.com/topic/2696-applied-spatial-data-analysis-with-r/
Good luck!
Can you post your code? This way we can see how you're handling your data.
If not, have a look at the apply functions in R (apply, sapply, lapply, etc.).