Re: [R-sig-Geo] Add coastline to an existing xyplot [SEC=UNCLASSIFIED]

2007-11-02 Thread hiemstra
Hi, You could use the function spplot in the sp-pacakge. Use the sp.layout argument to add the shapefile to the plot. All the data needs to be in one of the Spatial classes provided by the sp-package. The code could look something like: library(sp) library(maptools) points = read.table("points

Re: [R-sig-Geo] Spatial join of a point and polygon shapefile

2007-11-02 Thread Johan Van de Wauw
This is what I usually do: (points is a dataframe with x and y columns) library("sp") coordinates(points)=~x+y polygon<-readShapePoly("shapefile.shp") a<-overlay(points,polygon) # a will contain the id's of the polygons per point # . to get the attributes for every point I use: polygon[a,[EMAIL PR

Re: [R-sig-Geo] Spatial join of a point and polygon shapefile

2007-11-02 Thread Roger Bivand
On Fri, 2 Nov 2007, Honey Giroday wrote: > > Hi everyone > I am a new useR running R on a Windows platform with Emacs. I have been > searching package manuals and email archives trying to solve this > problem but have been unable to find a solution. Your help with this is > appreciated. > >

[R-sig-Geo] Spatial join of a point and polygon shapefile

2007-11-02 Thread Honey Giroday
Hi everyone I am a new useR running R on a Windows platform with Emacs. I have been searching package manuals and email archives trying to solve this problem but have been unable to find a solution. Your help with this is appreciated. I have generated random points within a polygon shapefile

Re: [R-sig-Geo] centering explanatory variables around spatial lag

2007-11-02 Thread Roger Bivand
On Wed, 31 Oct 2007, Sam Field wrote: > List, > > When the influence of explanatory variables "spills over" into adjacent > or proximate spatial units, one way to model this would be to include a > spatially lagged explanatory variable (WX). If there exists a > significant spatially lagged asso

Re: [R-sig-Geo] Divide a polygon by a line?

2007-11-02 Thread Agustin Lobo
Thanks Hisaji, The problem is that my line is not an straight line, but a very complex polyline (a boundary between types of forest manually digitized over aerial photography) imported from a shp file into a SpatialLinesDataFrame object. Regards, Agus Hisaji ONO escribio': > Hi. > > I've crea

Re: [R-sig-Geo] Divide a polygon by a line?

2007-11-02 Thread Hisaji ONO
Hi. I've create very simple example "cutting polygon by line c(0,5,10,5)" using by gpclib. library(maptools) library(gpclib) x1<-t(structure(c(0,0,10,0,10,10,0,10,0,0),dim=c(2,5))) # simple square ### method using buffer min_buffer_dist <- 1e-10 # set minimum value x2<-t(structure(c(-1,5