Dear R-users,
 I generate a dataset "d", and want to get a subset from it.
**
*z<-rnorm(9)
coords<-cbind(x=c(1,1,1,2,2,2,3,3,3),y=c(1,2,3,1,2,3,1,2,3))
d<-SpatialPointsDataFrame(coords, data.frame (z=z[1:9]))*
The result*/dataset* is
  coordinates           z
1      (1, 1)  1.41173570
2      (1, 2)  0.18546503
3      (1, 3) -0.04369144
4      (2, 1) -0.21591338
5      (2, 2)  1.46377535
6      (2, 3)  0.22966664
7      (3, 1)  0.10762363
8      (3, 2) -1.37810256
9      (3, 3) - 0.96818288
 Now I want oto get a subset with x(rows) and y(columns) being odd numbers ,
that is , i want the subset like the following:
    coordinates           z
    (1, 1)          1.41173570
     (1, 3)        -0.04369144
     (3, 1)         0.10762363
    (3, 3)        -0.96818288
I think that the steps maybe:
1.decompose coords into the original x and y;
2.select the odd numbers of x and y;
3.combine the selected x and y into coordinates, including the corresponding
z-values. This is the subset.
 Hope someone can solve it. I failed to get the subset.


--
Kind Regards,Zhi Jie,Zhang ,PHDDepartment of EpidemiologySchool of Public
HealthFudan UniversityTel:86-21-54237149

	[[alternative HTML version deleted]]

