[R] function for cumulative occurrence of elements

Steven K Friedman friedm69 at msu.edu
Tue Jun 28 14:55:13 CEST 2005


Hello, 

I have a data set with 9700 records, and 7 parameters. 

The data were collected for a survey of forest communities.  Sample plots 
(1009) and species (139) are included in this data set. I need to determine 
how species are accumulated as new plots are considered. Basically, I want 
to develop a species area curve. 

I've included the first 20 records from the data set.  Point represents the 
plot id. The other parameters are parts of the information statistic H'. 

Using "Table", I can construct a data set that lists the occurrence of a 
species at any Point (it produces a binary 0/1 data table). From there it 
get confusing, regarding the most efficient approach to determining the 
addition of new and or repeated species occurrences. 

ptcount <-  table(sppoint.freq$species, sppoint.freq$Point) 

 From here I've played around with colSums to calculate the number of species 
at each Point.  The difficulty is determining if a species is new or 
repeated.  Also since there are 1009 points a function is needed to screen 
every Point. 

Two goals are of interest: 1) the species accumulation curve, and 2) an 
accumulation curve when random Points are considered. 

Any help would be greatly appreciated. 

Thank you
Steve Friedman 


 Point        species frequency point.list point.prop   log.prop 
point.hprime
1      7   American elm         7         27 0.25925926 -1.3499267    
0.3499810
2      7          apple         2         27 0.07407407 -2.6026897    
0.1927918
3      7   black cherry         8         27 0.29629630 -1.2163953    
0.3604134
4      7      black oak         1         27 0.03703704 -3.2958369    
0.1220680
5      7    chokecherry         1         27 0.03703704 -3.2958369    
0.1220680
6      7         oak sp         1         27 0.03703704 -3.2958369    
0.1220680
7      7 pignut hickory         1         27 0.03703704 -3.2958369    
0.1220680
8      7      red maple         1         27 0.03703704 -3.2958369    
0.1220680
9      7      white oak         5         27 0.18518519 -1.6863990    
0.3122961
10     9   black spruce         2         27 0.07407407 -2.6026897    
0.1927918
11     9    blue spruce         2         27 0.07407407 -2.6026897    
0.1927918
12     9        missing        12         27 0.44444444 -0.8109302    
0.3604134
13     9  Norway spruce         8         27 0.29629630 -1.2163953    
0.3604134
14     9   white spruce         3         27 0.11111111 -2.1972246    
0.2441361
15    12          apple         2         27 0.07407407 -2.6026897    
0.1927918
16    12   black cherry         1         27 0.03703704 -3.2958369    
0.1220680
17    12   black locust         1         27 0.03703704 -3.2958369    
0.1220680
18    12   black walnut         1         27 0.03703704 -3.2958369    
0.1220680
19    12          lilac         3         27 0.11111111 -2.1972246    
0.2441361
20    12        missing         2         27 0.07407407 -2.6026897    
0.1927918




More information about the R-help mailing list