I would approach this by reading the data in using readOGR from rgdal
package. Once you get your projections in order, I would use one of the
functions in rgeos to find which "cubes" (let's call them squares for the
lack of a better term :) ) lie on the country border.
You can merge() your data from the "overlaid" object with your csv file by
cellnumbers.

HTH,
Roman



On Tue, Apr 9, 2013 at 3:26 PM, kamallauber <kamallauber@gmx.de> wrote:

> Hey people,
>
> first of all:I am Using R 2.15.3.
> I have 2 shapefiles (.shp+.dfb+...) and a csv-table.
> Now, one shape(1) is the border of germany and the other is a grid-like
> shapefile (2) (not a grid but many little cubes (1x1km). Now I want to have
> a grid-like shapefile but only in the boundaries of the first shapefile.
> Both of them are spatialpolygondataframes.
>
> The next step would then be, to get the values from the csv-table to the in
> the attribute table of the shapefile. The csv has a certain column
> 'cellnumber' which corresponds to a column in the grid-like shapefile (2).
>
> I know that this can easily be done with other gis software such as arcgis
> but i need to do it with R.
> Any help would be much appreciated.
>
> Greets, Matthias
>
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/Combining-shp-Files-and-csv-Data-tp7583245.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

