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. Thanks for the help [[alternative HTML version deleted]]
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
Hallo r-help-bounces at stat.math.ethz.ch napsal dne 11.04.2007 22:45:19:> 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. > Thanks for the helpInstead of looping try to look at aggregate, tapply or by. And give a quick look to posting guide where you can find some general rules and hints what to do before posting and how to formulate your question to get helpful answer. Regards Petr> > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.