Re: [R] Aggregating spatial data

2013-11-26 Thread David Carlson
To: dcarl...@tamu.edu Cc: r-help@r-project.org Subject: RE: [R] Aggregating spatial data Fantastic. Thanks very much! Is there an easy way to plot the points and the 4 areas? Best, Ioanna -Original Message- From: David Carlson [mailto:dcarl...@tamu.edu] Sent: 25 November 2013 15:21 To: &#x

Re: [R] Aggregating spatial data

2013-11-26 Thread IOANNA
Fantastic. Thanks very much! Is there an easy way to plot the points and the 4 areas? Best, Ioanna -Original Message- From: David Carlson [mailto:dcarl...@tamu.edu] Sent: 25 November 2013 15:21 To: 'IOANNA'; r-help@r-project.org Subject: RE: [R] Aggregating spatial data

Re: [R] Aggregating spatial data

2013-11-25 Thread David Carlson
Something like this? > s <- expand.grid(x=seq(1,100,by=1),y=seq(1,100,by=1)) > w <- data.frame(x=s$x,y=s$y,z1=rep(c(1,2,3,4),times=length(s$x/4)), + z2=seq(1,length(s$x),by=1)) > w$EW <- cut(w$x, breaks=c(.5, 50.5, 100.5), labels=c("West", "East")) > w$NS <- cut(w$y, breaks=c(.5, 50.5, 100.5), l