Re: [R] extract a value from vector

From: Paul Smith <>
Date: Tue 12 Sep 2006 - 18:11:01 GMT

On 9/12/06, Ethan Johnsons <> wrote:
> A quick question, please!
> How do you extract a certain value of vector?
> i.e. x = c(2,5,3,6,21,3,6,24, ....)
> How do you get the 1st one (which is 2); the 5th one (which is 21); etc?

Simple, Ethan:

x[1], x[5], ...

Paul mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed Sep 13 13:34:57 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 13 Sep 2006 - 04:30:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.