[R] Select.spatial on spplots
cls59
chuck at sharpsteen.net
Sun Sep 27 18:41:32 CEST 2009
Julius Tesoro wrote:
>
> Hi everyone. I posted this on R-sig-geo but got no response.
>
>
> Can select.spatial() be used in an existing spplot? I have tried selecting
> points (eq) from a plot generated from sp. However, when I invoke
> select.spatial(eq). It generates only the points without the background
> containing the faults. I need the background to select which earthquakes
> coalesce on which fault. Is there an alternative?
>
> eq.pts<-list("sp.points",eq, col="blue", lwd=0.5, pch = 4)
>
> spplot(faults,"Dip", xlim = c(110000,120000),
> ylim = c(3760000,3890000),
> sp.layout=list(eq.pts),
> col = heat.colors(3))
>
> select.spatial(eq)
>
> Cheers,
>
> Julius Tesoro
>
>
Unfortunately, it looks like select.spatial() wipes the plotting region by
executing it's own call to plot(). However, the function it's self is very,
very simple, just type:
select.spatial
To see what goes on inside. It looks like you could obtain point-wise
selection by just calling identify():
identify( coordinates( eq )[,1], coordinates( eq )[,2]
To use areas, call locator() and then process the results using
point.in.polygon().
As for whether this will work using a spplot-- I really couldn't say. I was
not able to reproduce a spplot using the information you provided-- lack of
a working example may be a reason you got nothing but silence on R-sig-geo.
Good luck!
-Charlie
-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
--
View this message in context: http://www.nabble.com/Select.spatial-on-spplots-tp25632668p25635166.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list