[R-sig-Geo] Indicator kriging map creation

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Jul 24 20:04:19 CEST 2011


Matevz, try

z$class = factor(apply(cbind(z$dva.pred, z$ena.pred, z$nic.pred,
	z$stiri.pred, z$tri.pred), 1, which.max),
	labels=c("dva", "ena", "nic", "stiri", "tri"))
spplot(z["class"])


On 07/24/2011 06:22 PM, Matevž Pavlič wrote:
> Hi list users, 
> 
>  
> 
> i am trying to do indicator kriging on a set of soild samples. 
> 
>  
> 
> I manage to do the predction of several classes  into a  "SpatialPixelsDataFrame" using the gstat object and predict() function. First a created a  gstat object of several soil classes which I later fitted with a linear model of coregonalization. 
> 
>  
> 
> After that i used predict() to generate a SpatialPixelsDataFrame which hold information about predictions, variance and covariances. 
> 
>  
> 
> I am mostly interested in predoctions of each class. I know how to create a spplot or levelplot of each of the predicted classes on its own, but what i would like to achieve is to create a map of this predictions, so that the class with highest value (from 0-1) would prevail on each of the grid cell. In this way i would get a map of soil classes. 
> 
>  
> 
> Attached is the reproducible sample and a picture of prediction that i would like covert to a map of Soil classes (SoilFactor). But i get stuck when i try to create a actual map. That means getting the max value of each pixels and assign a name to that pixel.
> 
>  
> 
> I hope i explained ok, if not i'll try again. 
> 
>  
> 
> Thanks for any ideas or help, m
> 
> 
> 
> 
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list