Dear all of you,

I would like if someone can help me to know how I can read a matrix looking for positions in the matrix that are not null.
I have a matrix with most of the "cells" or "positions" null, I am trying to know the invasion power of a plant (number 1 in the matrix when t==1).
I would like to continue the model writing some condition when the value of the matrix in not null, but I don't know what function or loop I have to use to find the values > than 0 for the next step.

pop <- matrix(0,7,7)# Population matrix when t==0
pop[sample(1:length(pop),1)] <-1 #Population matrix when t==1

Thanks a lot,
Judit

	[[alternative HTML version deleted]]

