[R] Matching Up Values

Peter Alspach PAlspach at hortresearch.co.nz
Thu Jul 17 22:55:05 CEST 2008


Steve

?merge

and the all collection of arguments

Peter Alspach


> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Steve Murray
> Sent: Friday, 18 July 2008 8:43 a.m.
> To: r-help at r-project.org
> Subject: [R] Matching Up Values
> 
> 
> Dear all,
> 
> I have two files, both of similar formats. In column 1 are 
> Latitude values (real numbers, e.g. -179.25), column 2 has 
> Longitude values (also real numbers) and in one of the files, 
> column 3 has Population Density values (integers); there is 
> no column 3 in the other file.
> 
> However, the main difference between these two files is that 
> one has fewer rows than the other. So what I'm looking to do 
> is, 'pad out' the shorter file, by adding in the rows with 
> those that are 'missing' from the longer file (ie. if a 
> particular coordinate isn't present in the shorter file but 
> is in the 'longer/master' file), and having 'zero' as its 
> Population Density value (column C).
> 
> This should result in the shorter file becoming the same 
> length as the initially longer file, and with each file 
> having the same coordinate values (latitude and longitude on 
> each line).
> 
> How would I do this in R?
> 
> Thanks for any help offered,
> 
> Steve
> 
> _________________________________________________________________
> The John Lewis Clearance - save up to 50% with FREE delivery
> 
> ______________________________________________
> 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.
> 

The contents of this e-mail are privileged and/or confidential to the named
 recipient and are not to be used by any other person and/or organisation.
 If you have received this e-mail in error, please notify the sender and delete
 all material pertaining to this e-mail.



More information about the R-help mailing list