[R] how to generate a column based on other columns in a data frame

From: Weidong Gu <wgu_at_uab.edu>
Date: Mon, 11 Feb 2008 10:30:06 -0600


HI,  

I am working on a data set with multiple collections of mosquitoes at sampling sites. Each row represents a collection of individual samples with coordinates for each collection.

... X, Y,...

1 36.435 30.118

2 36.435 30.118

3 36.435 30.118

4 35.329 29.657

5 35.329 29.657

6 36.431 30.111

7 36.431 30.111

8 35.421 29.797

9 35.421 29.797

10 35.421 29.797  

Unfortunately, there is no 'site' entry. I would like to add a column of 'site' based on the coordinates of samples so that samples from the same sites have the same site ID like S1, S2,....  

How to do this in R way? Thanks.    

Weidong Gu,

Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294 Email: wgu_at_uab.edu
PH: (205)-975-9053  

        [[alternative HTML version deleted]]



R-help_at_r-project.org 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 Mon 11 Feb 2008 - 16:37:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Feb 2008 - 17:30:12 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.

list of date sections of archive