[R-sig-Geo] STIDF subsetting problem
scizmeli
sa.cizmeli at usherbrooke.ca
Sat Jun 15 16:35:34 CEST 2013
I am trying rearrange the rows of a STIDF object using a numerical variable
idx containing the row indexes having some repeated indexes :
data(air)
rural = as(rural,"STIDF")
rural[c(1,1,1)]
gives me only a 1-row STIDF object. I would rather expect a 3-rows STIDF
object, with the replicates of the 1st row.
The general behavior of R in such a case, however, would be to replicate the
rows. I give below two examples with data.frame and list objects ;
a=data.frame(a=c(1,2,3,4),b=c(1,3,4,5))
a[c(1,1,1),]
or
a=list(k=1,l=2,m=3)
a[c(1,1,1)]
Is this behavior of spacetime (namely the internal function subs.STIDF) can
be modified in the future to provide a more compatible with the R standards?
In its current way, it is not possible to use the subsetting in a
traditional R-fashion.
thanks
Servet
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/STIDF-subsetting-problem-tp7583785.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
More information about the R-sig-Geo
mailing list