Skip to content

Extract values based on indexes without looping?

4 messages · Sean Zhang, David Winsemius, Jorge Ivan Velez +1 more

#
[1] "c" "b" "b" "a"
On Dec 23, 2008, at 9:52 PM, Sean Zhang wrote:

            
#
On Tue, 23 Dec 2008, Sean Zhang wrote:

            
You need to read

 	An Introduction to R

particularly this section:

 	2.7 Index vectors; selecting and modifying subsets of a data set

...

 		2. A vector of positive integral quantities

Also, see

 	?Subscript

and run

 	example( Subscript )

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901