[R] indexing a vector starting from 0

2005-07-24 Thread Federico Calboli
Hi All, I would like to ask if it possible to start indexing a vector from 0: x = 1:10 y = c(0,0,3,4,5,6,0,8,9,10) I need to use y as an index to extract the values of x, BUT I cannot cull/transform the 0s. What I would like is to start counting the elements of x 0:9 rather than 1:10.

Re: [R] indexing a vector starting from 0

2005-07-24 Thread Sean Davis
On Jul 24, 2005, at 4:29 PM, Federico Calboli wrote: Hi All, I would like to ask if it possible to start indexing a vector from 0: x = 1:10 y = c(0,0,3,4,5,6,0,8,9,10) I need to use y as an index to extract the values of x, BUT I cannot cull/transform the 0s. What I would like is to

Re: [R] indexing a vector starting from 0

2005-07-24 Thread Peter Dalgaard
Federico Calboli [EMAIL PROTECTED] writes: Hi All, I would like to ask if it possible to start indexing a vector from 0: x = 1:10 y = c(0,0,3,4,5,6,0,8,9,10) I need to use y as an index to extract the values of x, BUT I cannot cull/transform the 0s. What I would like is to start