Simon Parker
2008-May-08 12:04 UTC
[R] How to compare a value in a matrix with its neighbours
Hello. I'm trying to compare a value in a 2-D matrix with its 4 neighbours. I think I could use row() and col() and use x[row(x)] and x[row(x)-1] etc..., but I can't see how it would work. Also, any way of having a matrix fill itself with its own coordinates would also work. Any ideas please. Simon Parker Imperial College --------------------------------- A Smarter Email. [[alternative HTML version deleted]]