Re: [R] extract a value from vector

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

On 9/12/06, Ethan Johnsons <ethan.johnsons@gmail.com> 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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.