[R] Repeated Procedures

afsouza at unisinos.br afsouza at unisinos.br
Tue Jul 27 01:41:43 CEST 2010

Dear Friends,

    Using package Vegan, I need to calculate Shannons Diversity index
and Pielou's Evenness for a set of 20 study areas. Each area is
represented by a matrix of 25 sample plots x tree species. The code is
as following, where data stands for the data matrix of any of the 20

S <- specnumber(data)
H <- diversity(data)
J <- H/log(S)

     I indexed the 20 areas by a column with the number of each of the
areas and have been trying to formulate a code to iterate this procedure
for each of the 20 areas and save the results in a table, but I have not
been successful. 

    Do anyone have a hint on how to do that?

    Thaks very much in advance,



Dr. Alexandre F. Souza 
Programa de Pós-Graduação em Biologia: Diversidade e Manejo da Vida
Universidade do Vale do Rio dos Sinos (UNISINOS)
Av. UNISINOS 950 - C.P. 275, São Leopoldo 93022-000, RS  - Brasil
Telefone: (051)3590-8477 ramal 1263
Skype: alexfadigas
afsouza at unisinos.br

Esta mensagem foi verificada pelo sistema de antivírus e
 acredita-se estar livre de perigo.

More information about the R-help mailing list