Simple codes to carry out spatial analysis in R