Assuming your data frame is called dat something like
dat[(dat$x-a)^2+(dat$y-b)^2<=k,]
should work I think.
On 5/25/06, zhang jian <jzhang1982@gmail.com>
wrote:>
> I want to get the data in a circle from a large square plot.
>
> If the data includes only two columns or more columns which is number
> style,
> I can do it.
> But if the data includes other columns which is not number style (e.g.
> species name), I donot know how to do it. And I donot want to delete the
> columns because it is useful to me.
> e.g. species x y
> a 12 20
> b 20 50
> c 14 25
> ... ... ...
>
> Thanks!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
[[alternative HTML version deleted]]