Skip to content
Prev 86249 / 398528 Next

how do I "relate" tables in R?

thanks, Andy and John, for suggestions.
worked great.
jeff 


******************************************
Jeffrey Moore, Ph.D.
Postdoctoral Research Scientist
Duke Center for Marine Conservation
Duke University Marine Laboratory
135 Duke Marine Lab Road
Beaufort, NC 28516
Phone: (252) 504-7653
Fax: (252) 504-7689
Email: jemoore at duke.edu
*****************************************

-----Original Message-----
From: John Fox [mailto:jfox at mcmaster.ca] 
Sent: Friday, February 10, 2006 10:13 PM
To: 'Jeffrey Moore'
Cc: colchero at duke.edu; r-help at stat.math.ethz.ch
Subject: RE: [R] how do I "relate" tables in R?

Dear Jeff,

Assuming that the column named "z" in the matrix data2 already exists and
has arbitrary content (such as 0's or NA's), how about the following?

data2[,"z"] <- data1[data2[,"ID"], "z"]

I hope this helps,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox
--------------------------------