Organizing and commenting spatialModel.R