Skip to content
Prev 4990 / 7420 Next

doubt in generating loops with For

Hi Thiago,
I am not familiar with the diversity measure you are trying to calculate 
and your example code is not complete - one can not simulate your comm 
and dist objects.
But at the first sight one can see that in your loop you are trying to 
select columns 1, 2, 3,... 1000 from the comm matrix, which probably has 
only 10 columns (if sites are in columns and species in rows, contrary 
to how such data are traditionally stored).

for(z in 1:10)
instead of
for(z in 1:1000)
should do the job.

Vit

Dne 2015-04-15 23:24, Thiago A. Pires napsal: