Re: [R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Steven McKinney
> > -Original Message- > From: [EMAIL PROTECTED] on behalf of Yasir Kaheil > Sent: Tue 5/6/2008 4:24 PM > To: r-help@r-project.org > Subject: Re: [R] Spatial join between two datasets using x and y co-ordinates > > > vector dat1.select is the selecte

Re: [R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Jorge Ivan Velez
Hi Andrew, Try also: x1<-c(1824615,1823650,1821910) y1<-c(5980732,5983220,5990931) descript<-c("cat", "dog", "horse") dat1<-data.frame(x1,y1,descript) x2<-c(1824615,1823650) y2<-c(5980732,5983220) dat2<-data.frame(x2,y2) colnames(dat2)=c('x1','y1') merge(dat1,dat2,by=c('x1','y1')) HTH, Jorge

Re: [R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Yasir Kaheil
vector dat1.select is the selected records from dat1 by dat2. > dat1.select<- dat1$x1 %in% dat2$x2 & dat1$y1 %in% dat2$y2 > dat1[dat1.select,] x1 y1 descript 1 1824615 5980732 cat 2 1823650 5983220 dog Andrew McFadden wrote: > > Hi R users > > I am trying to create a sp

Re: [R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Peter Alspach
Andrew ?merge HTH .. Peter Alspach > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Andrew McFadden > Sent: Wednesday, 7 May 2008 9:23 a.m. > To: r-help@r-project.org > Subject: [R] Spatial join between two datasets u

[R] Spatial join between two datasets using x and y co-ordinates

2008-05-06 Thread Andrew McFadden
Hi R users I am trying to create a spatial join between two datasets. The first data set is large and contains descriptive data including x and y co-ordinates. The second dataset is small and has been selected spatially. The only data contained within the second dataset is the x and y coordina