[R-sig-Geo] extract matrix values using circular window
Rolf Turner
r.turner at auckland.ac.nz
Fri Mar 16 07:44:45 CET 2012
On 16/03/12 17:23, Lorenzo Cattarino wrote:
> Hi,
>
> I am trying to extract the values of the following matrix
>
> my.mat<- matrix(sample(c(1,0),100,replace=T),ncol=10)
>
> using a circular window/mask. I would like to be able to choose coordinates of window centre and circle radius. I looked into the raster and spatstat packages, and specifically the function disc(), but I could not get them to work properly.
>
> Any help is really appreciated.
Your question makes no sense at all to me. WTF has your 10 x 10 matrix of
random zeroes and ones got to do with a circular window?
If you could actually explain what you are trying to do, I could
probably tell you how
to do it.
cheers,
Rolf Turner
More information about the R-sig-Geo
mailing list