| phi | R Documentation | 
Hubbell's phi: counts of species abundances
phi(x,addnames=TRUE)
unphi(freq, string="spp")
x | 
 Ecosystem vector; is coerced to class   | 
addnames | 
 Boolean, with default
  | 
freq | 
 Frequency data (eg as returned by   | 
string | 
 Character; species name to prepend (using   | 
Function phi() coerces its argument to a count object and
by default returns a named vector whose ith element is the
number of species with i individuals.  The name of the
ith element is the species with abundance i if unique
and empty otherwise.  Function phi() is used by
theta.prob().
Function unphi() does the reverse: given the output of
phi(), it returns a corresponding count object.  Note that
species names are lost.
The code for setting the names is a dog's breakfast
Robin K. S. Hankin
S. P. Hubbell 2001. “The Unified Neutral Theory of Biodiversity”. Princeton University Press.
preston
jj <- c(rep("oak",5) ,rep("ash",2),rep("elm",3),"pine","tea","yew")
a <- as.count(jj)
phi(a,addnames=FALSE) # three singleton spp, one species with abundance 2, etc
unphi(phi(a))   #should match 'a' except for species names (which are lost)
data(butterflies)
phi(butterflies,add=FALSE)
summary(unphi(phi(butterflies)))  #should match 'summary(butterflies)'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.