# Spatial Analysis with Factors/Classifications

When doing analysis on spatial data with associated information that is numeric, it is possible to use techniques such as Kriging or Interpolation or Cluster Analysis to find out interesting relationships in your data. Then you can visualise using your choice of poison/GIS. Okay.

Now, I want to do the same type of things with spatial data that has associated non-numeric data, i.e. a "Factor" in R or a "Classification". However I cannot find techniques that allow one to do this.

Does anyone know of methods that can be used to perform this type of analysis? It would also be a bonus you know whether they can be performed in R or QGIS.

I would really love a model to do interpolation with a non-numeric attribute. The set I would use this interpolation on would be lithology or other geological data.

• Will upvote those answers when I get my rep up. Jan 21, 2013 at 14:49
• I believe you can vote on answers to your own question regardless of your rep. Jan 21, 2013 at 16:43
• You can use kriging and cluster analysis with nominal data. See, for instance, the geoRGLM package for `R`, which supports generalized linear models of spatial data. Note, too, that although rasters internally represent data as numbers, that is no different than how `R` encodes factors and has the same intention: a so-called "integer" grid can be used to represent a spatial field of factor values (such as land use classes). All raster-based GISes have tools to support such an interpretation. Jan 21, 2013 at 16:47
• It's mathematically possible, but I don't think it is proper way. Lithology/geology is discrete phenomenon. If you have to do this, try to find co-variable (DEM?) and use co-kirging. Other methods are delaunay triangulation and voronoi polygons. If density of points is high, results can be good. Jan 21, 2013 at 17:38
• I am not sure how to correctly treat converting factors to numbers (or letting my GIS do that for me) For example if I have "Oak"=5 and "Pine"=4 how do I interpret a point/point on raster where the value is 4.4? Or is it mathematically sound for me to round that value as it is closer to pine? Jan 21, 2013 at 22:48