Hello everyone. I have been dealing with this for a while. I have built a spatial prediction model for densities of mosquitoes on a field, based om empirical data. I need to plot the field area with the predicted densities in a heatmap, contour or likewise, and compare it visually with i.e. a loess prediction (which works well). But no matter what I do, I cannot come across the problem that the x and y values should be in ascending order. Why is this necessary? I have tried using the unique() function as mentioned earlier, but it only removes some data points. Please help me, I will appreciate any advice. Best regards Carsten Kirkeby -- View this message in context: http://r.789695.n4.nabble.com/Contour-data-points-not-in-ascending-order-tp2271903p2271903.html Sent from the R help mailing list archive at Nabble.com.
Hi again. I have made an example of my data: x<-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4) y<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) z <- c(12,23,23,42,12,1,1,32,5,45,65,76,32,21,23,43) data <- unique(cbind(x,y,z)) contour(x,y,z, col="red", xlim=c(0,1), ylim=c(0,1), labcex=0.7, cex="12") -which gives an error message. /CK -- View this message in context: http://r.789695.n4.nabble.com/Contour-data-points-not-in-ascending-order-tp2271903p2271905.html Sent from the R help mailing list archive at Nabble.com.