Dear list, 
I have a spatial data frame made of 533 point observations. I'd to split it in a 
validation data set (133 points) and divide the remainig points in a number of 
calibration data sets of 40 points each one(400/10)
The code I made works almost fine but there are some points that overlap: I post 
here an example using the meuse data set:

require(sp)
data(meuse)
coordinates(meuse)<- ~ x+y
set.seed(2540)
  valid.id <- sample(1:dim(meuse@data)[1], 25)
  meuse.val<- meuse[valid.id,]
  str(meuse.val)
  meuse.calibration<- meuse[!is.element(1:dim(meuse@data)[1], valid.id),]
  str(meuse.calibration); dim(meuse.calibration)
  cal.id<- vector("list",10)
  set.seed(2540)
  for(i in 1:10) {
            cal.id[[i]]<- sample(1:dim(meuse.calibration@data)[1], 13)
            meuse.calibration<- 
meuse.calibration[!is.element(1:dim(meuse.calibration)[1], cal.id[1:i]),]
             }
  sapply(cal.id,length)
  meuse.calibration<- meuse[!is.element(1:dim(meuse@data)[1], valid.id),]  
#create again the calibration data set
  dim(meuse.calibration@data)
  meuse.cal<- vector("list",10)
  for(i in 1:10) meuse.cal[[i]] <- meuse.calibration[cal.id[[i]],]
  plot(meuse.cal[[1]])
  for(i in 2:10) points(meuse.cal[[i]], pch=2:10, col=2:10)
  points(meuse.val, pch=20, col="blue", cex=1.2)
  rm(valid.id, cal.id)

Any help will be appreciate.
 Thanks a lot

Giuseppe

	[[alternative HTML version deleted]]

