[R-sig-Geo] merging tables by columns AND row names (coordinates)
Michael Sumner
mdsumner at utas.edu.au
Fri Sep 8 00:26:42 CEST 2006
Hello, I can think of a couple of simple-minded approaches that would
take some time - either relying on direct string-matching for the unique
coordinates, or by some contrived overlay.
However, there's probably far better approaches - a couple of questions:
Can you predefine the set of all unique coordinates without reading all
the tables from file?
- if so you might simplify the identification of each individual
coordinate, for matching the records
Are the coordinates (intended to be) on a regular grid? (This seems
unlikely, although it is nearly true given your X coordinates).
Cheers, Mike.
isidora k wrote:
> Hi everyone!
> I have 100 tables of the form:
> XCOORD,YCOORD,OBSERVATION
> 27.47500,42.52641,177
> 27.48788,42.52641,177
> 27.50075,42.52641,179
> 27.51362,42.52641,178
> 27.52650,42.52641,180
> 27.53937,42.52641,178
> 27.55225,42.52641,181
> 27.56512,42.52641,177
> 27.57800,42.52641,181
> 27.59087,42.52641,181
> 27.60375,42.52641,180
> 27.61662,42.52641,181
> ..., ..., ...
> with approximately 1000000 observations for each. All
> these tables have the same xcoord and ycoord and I
> would like to get a table of the form
> XCOORD,YCOORD,OBSERVATION1,OBSERVATION2,...
> 27.47500,42.52641,177,233,...
> 27.48788,42.52641,177,345,...
> 27.50075,42.52641,179,233,...
> 27.51362,42.52641,178,123,...
> 27.52650,42.52641,180,178,...
> 27.53937,42.52641,178,...,...
> 27.55225,42.52641,181,...
> 27.56512,42.52641,177,...
> 27.57800,42.52641,181,...
> 27.59087,42.52641,181,...
> 27.60375,42.52641,180,...
> 27.61662,42.52641,181,...
> In other words I would like to merge all the tables
> taking into account the common row names of their
> xcoords AND ycoords.
> Not all tables have the same number of observations
> which means that not all pairs of x and y coords
> match.
> Is there a way to do this in R?
> I would be grateful for any advice.
> Many thanks
> Isidora
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
More information about the R-sig-Geo
mailing list