<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Produces simulated communities based on species attributes</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for trait.asm"><tr><td>trait.asm</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Produces simulated communities based on species attributes</h2>

<h3>Description</h3>

<p><code>trait.asm</code> calculates phylogenetic biodiversity metrics
</p>


<h3>Usage</h3>

<pre>
trait.asm(
  a,
  m = 1000,
  meanSR = NULL,
  interval = c(0.001, 10),
  exponential = TRUE,
  Pscale = 1
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>a</code></td>
<td>
<p>species attributes (e.g., traits like body size)</p>
</td></tr>
<tr valign="top"><td><code>m</code></td>
<td>
<p>number of communities to be simulated</p>
</td></tr>
<tr valign="top"><td><code>meanSR</code></td>
<td>
<p>target mean species richness across simulated communities</p>
</td></tr>
<tr valign="top"><td><code>interval</code></td>
<td>
<p>adjust to obtain <code>meanSR</code></p>
</td></tr>
<tr valign="top"><td><code>exponential</code></td>
<td>
<p>use the exponential distribution when simulating communities</p>
</td></tr>
<tr valign="top"><td><code>Pscale</code></td>
<td>
<p>adjust this value when not using the exponential distribution in order to scale the species richnesses in the simulated communities</p>
</td></tr>
</table>


<h3>Details</h3>

<p>Simulates a set of communties based on the supplied attribute (trait) where larger values make it more likely for species to be in the communities.
</p>


<h3>Value</h3>

<p><code>Y</code> presence/absence matrix
</p>
<p><code>P</code> probabilities
</p>
<p><code>a</code> the supplied trait
</p>
<p><code>exponential</code> if the exponential distribution was used
</p>
<p><code>meanSR</code> supplied <code>meanSR</code> value
</p>
<p><code>std</code> estimated sd
</p>


<h3>Author(s)</h3>

<p>M.R. Helmus
</p>


<h3>References</h3>

<p>Helmus M., Mercado-Silva N. &amp; Vander Zanden M.J. (2013). Subsidies to predators, apparent competition and the phylogenetic structure of prey communities. Oecologia, 173, 997-1007.
</p>


<h3>Examples</h3>

<pre>
## Not run: 
 data(laja)
 trait.asm(laja$fish.pref)

## End(Not run)
</pre>


</body></html>
