Skip to content
Prev 9025 / 29559 Next

spRbind for spplot

Hi Klaus,
Following up on Pauls suggestion, I think the best is first to make sure 
that you have the same column names in both objects:

observations$var1.pred = NA
predictions$QNORM_12_4 = NA
obs = observations[,c("QNORM_12_4","var1.pred")]
pred = predictions[,c("QNORM_12_4","var1.pred")]
# Now both objects should just contain columns for observations and 
predictions

Then you most likely have to make sure that you have different polygon 
IDs in the two objects. You can try without first, but will most likely 
get an error. If the following does not work, try a larger number:
pred = spChFIDs(pred,as.character(1000+c(1:dim(pred)[1])))

You can then combine the objects:
plot_poly = spRbind(obs,pred)

spplot(plot_poly,c("QNORM_12_4","var1.pred"))

Hope this works!
Jon