hard to figure out the issue here, but merging should always be done with
great care since you may totally mess up your data. Take a really close look
at the ?merge help file there is a lot of fine print there. Also check
"CTYCODE" "f00012" is they are string vars make sure the spelling is
identical including trailing blanks, etc. also look at the all all.x and
all.y options. They may explain why you end up with no rows of data (there
may be no match).
Hth,
j.
-----Original Message-----
From: gov2001-l-bounces at
lists.fas.harvard.edu [mailto:gov2001-l-
bounces at
lists.fas.harvard.edu] On Behalf Of Keith Schnakenberg
Sent: Sunday, March 30, 2008 4:15 PM
To: gov2001-l at
lists.fas.harvard.edu
Subject: [gov2001-l] trouble merging data frames
I am merging to data frames based on common county codes assigned in
the same way by both datasets. Here is the code:
data <- merge(sample, arf, by.x="CTYCODE", by.y="f00012")
I do not get any errors or warnings, but the merged data frame is
just a list of variable names with no rows below them.
I haven't used merge() before, and I am having difficulty figuring
out what might cause this. It's kind of costly to experiment with a
bunch of different arguments as it takes like 20 minutes for the
thing to run each time. Does anybody have any advice?
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l