Displaying 1 result from an estimated 1 matches for "samplewidth".
2010 Dec 31
4
Repeated Indexing / Sequence Operation
...R-friendly way to
approach this
Example
# InitialIndices
i2 = (90, 190, 290)
# Indices I want to end up with
i3 = c(85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 185, 186, 187, 188, 189,
190, 191, 192, 193, 194, 195
285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295)
# A way to get Final Indices
SampleWidth
i3 = c(i2)
for (j in seq(1, SampleWidth )) {
i3 = c(i3, i2 + j )
i3 = c(i3, i2 - j )
}
I tried to tackle this with seq and the apply families but got nowhere
Thanks and Happy New Year
Paolo
[[alternative HTML version deleted]]