Re: [R] Matching Up Values

From: Peter Alspach <PAlspach_at_hortresearch.co.nz>
Date: Fri, 18 Jul 2008 08:55:05 +1200

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.



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 Thu 17 Jul 2008 - 20:57:41 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 Thu 17 Jul 2008 - 21:32:45 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