[R] Looping through series of names

Charles C. Berry cberry at tajo.ucsd.edu
Thu Apr 12 07:28:47 CEST 2007

On Wed, 11 Apr 2007, Spilak,Jacqueline [Edm] wrote:

> Hi
> I am very new to R and have not able to find the answer to my question
> in the manual or any other post.  I have a dataset that has various
> different sites names with data relating to each site.  The data is in
> one dataset.  I want to loop through the different site names and
> perform my test on each site.  The sites are named not numbers for
> example "YYC".  How do I do this.  I hope I was clear enough.

I guess that the 'names' are or could be represented by a 'factor' much 
like the variable 'state' in the 'specific example' in

 	'An Introduction to R' Section 4

If the 'manual' have consulted was not 'An Introduction...', do as the 
__posting guide__ suggests:

 	"Read at least the relevant section in An Introduction to R"

If that section (and the rest of 'An Intro...' for that matter) and the 
help pages for the functions mentioned there do not answer your question, 
it would probably help elicit a useful response to spell out how your 
problem differs from those addressed therein.

[rest deleted]

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

More information about the R-help mailing list