[R] merge

From: Ling Jin <ljin_at_lbl.gov>
Date: Sat 09 Jul 2005 - 09:55:13 EST


Hi all,

I have two data frames to merge by a column containing the site names (as characters). However, somehow, one of the site names of one data frame have fixed length, say 8, so the names sometimes have spaces at the end. For example, the site name is "ST", but in one data frame, it

is "ST        ". Therefore, the merge function won't recognize that "ST" 
and "ST       " are the same, so won't merge accordingly.

Is there a easy way to deal with it? Or I should do something during data import? (BTW, I imported the data using read.csv)

Thanks!

Ling



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 09 09:58:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:26 EST