Dear Yong Zhang,

    You may check the examples of function  matrix2sample , in picante package, using the following commands:
    library(picante)    
    data(phylocom)
    matrix2sample(phylocom$sample)
    It may give the results that you want (or may be with slightly modification of the orignial code).
    Cheers,
    Jinlong


2010-12-21 



Jinlong Zhang 
Ph.D.Candidate
State Key Laboratory for Vegetation and Environmental Change,
Institute of Botany, The Chinese Academy of Sciences
Nanxincun 20,Xiangshan, Beijing 100093
E-mails: 
zhangjl@ibcas.ac.cn
jinlongzhang01@gmail.com



发件人： Yong Zhang 
发送时间： 2010-12-21  20:00:18 
收件人： r-sig-ecology 
抄送： 
主题： [R-sig-eco] How to change the pattern of my dataset?? 
 
Dear all
I have to appologize in advance , because I am very new about this. Thing is like this, now I have a dataset containing species abundance, species names and sampling sites. See below:
           site1  site2 site3 site4.............
A           2      3      4     2
B           5      6      5     2
C           4      3      4     5
D           4      5      4     1
.
.
.
.
.
.
.
.
How should I do to change it into a dataset like below:
site1 A 2
site1 B 5 
site1 C 4 
site1 D 4 
.
.
.
.
.
.
site2 A 3 
site2 B 6
site2 C 3 
site2 D 5
.
.
.
.
.
.
site3 A 4
site3 B 5
site3 C 4
site3 D 4
.
.
.
.
.
site4 A 2
site4 B 2
site4 C 5
site4 D 1
.
.
.
.
.
.
.
Could one know which package should I take?  And, which function shou I use? Please answer in details if you can. Thanks very much for you time and suggestion.
All the best.
  
Yong Zhang, Ph.D.
Lab of aquatic insects & stream ecology
Dept.of Entonology, Nanjing Agricultural University
Nanjing, 210095,China 
Phone number:  (+86) -25-84395241
E-mail:2010202035@njau.edu.cn
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

	[[alternative HTML version deleted]]

