[R] indexing question

Ray Brownrigg Ray.Brownrigg at mcs.vuw.ac.nz
Mon Nov 13 21:48:30 CET 2006


On Tuesday 14 November 2006 09:28, Leeds, Mark (IED) wrote:
> thanks beilton but that won't work. A diff will also include 61-41 etc
> and I don't want to include those.
>
> I'm working on using lapply or sapply with a seq along 31, 61, etc.
> I'll let you know if it works.
>

Try looking at:
dim(idx) <- c(3, length(idx)/3)
then:
tmp[idx[2, ]] - temp[idx[1, ]]
temp[idx[3, ]] - temp[idx[2, ]]

HTH
Ray Brownrigg



More information about the R-help mailing list