Description Usage Arguments Details Value Author(s) Examples

View source: R/CommunityProfile.R

Calculates the diversity or entropy profile of a community, applying a community function to a vector of orders.

1 2 3 4 5 6 7 8 9 10 | ```
CommunityProfile(FUN, NorP, q.seq = seq(0, 2, 0.1),
NumberOfSimulations = 0, Alpha = 0.05, BootstrapMethod = "Chao2015",
..., CheckArguments = TRUE)
as.CommunityProfile(x, y, low = NULL, high = NULL)
is.CommunityProfile(x)
## S3 method for class 'CommunityProfile'
plot(x, ..., main = NULL,
xlab = "Order of Diversity", ylab = "Diversity", ylim = NULL,
LineWidth = 2, ShadeColor = "grey75", BorderColor = "red")
CEnvelope(Profile, LineWidth = 2, ShadeColor = "grey75", BorderColor = "red", ...)
``` |

`FUN` |
The function to be applied to each value of |

`NorP` |
A numeric vector or a two-column matrix. Contains either abundances or probabilities. Two-column matrices should contain the observed abundances (or probabilities) in the first column and the expected ones in the second column, to allow using beta diversity functions. |

`q.seq` |
A numeric vector: the sequence of divrsity orders to address. Default is from 0 to 2. |

`NumberOfSimulations` |
The number of simulations to run, 0 by default. |

`Alpha` |
The risk level, 5% by default. |

`BootstrapMethod` |
The method used to obtain the probabilities to generate bootstrapped communities from observed abundances. See |

`x` |
An object to be tested or plotted or the vector of orders of community profiles in |

`y` |
Entropy or diversity values of each order, corresponding to |

`low` |
Entropy or diversity lower bound of the confidence envelope, corresponding to |

`high` |
Entropy or diversity higher bound of the confidence envelope, corresponding to |

`Profile` |
An |

`...` |
Additional arguments to be passed to |

`main` |
The main title of the plot. |

`xlab` |
The x axis label of the plots. |

`ylab` |
The y axis label of the plot. |

`ylim` |
The interval of y values plotted. |

`LineWidth` |
The width of the line that represents the actual profile. |

`ShadeColor` |
The color of the shaded confidence envelope. |

`BorderColor` |
The color of the bounds of the confidence envelope. |

`CheckArguments` |
Logical; if |

The function `CommunityProfile`

is used to calculate diversity or entropy profiles based on community functions such as `Tsallis`

or `ChaoPD`

. The first two arguments of the function must be a probability or abundance vector or a two-column matrix (for beta diversity functions) and a number (*q*).
Additional arguments cannot be checked. Unexpected results may be returned if `FUN`

is not used properly.

If `NumberOfSimulations`

is greater than 0, a bootstrap confidence interval is produced by simulating communities with `rCommunity`

and calculating their profiles.

`CommunityProfile`

objects can be plotted. They can also be added to the current plot by `CEnvelope`

.

A `CommunityProfile`

, which is a list:

`x` |
The order |

`y` |
The entropy or diversity values returned by |

`low` |
The lower bound of the confidence interval |

`high` |
The upper bound of the confidence interval |

Eric Marcon <Eric.Marcon@ecofog.gf>, Bruno Herault <Bruno.Herault@ecofog.gf>

1 2 3 4 5 6 7 8 9 10 11 12 | ```
# Load Paracou data (number of trees per species in two 1-ha plot of a tropical forest)
data(Paracou618)
# Plot diversity estimated without bias correction
plot(CommunityProfile(Diversity, Paracou618.MC$Ps, seq(0, 2, 0.2)),
lty=3, ylim=c(50, 350))
# Estimate diversity, with a condidence envelope
# (only 10 simulations to save time, should be 1000)
Profile <- CommunityProfile(Diversity, as.AbdVector(Paracou618.MC$Ns),
seq(0, 2, 0.2), Correction="UnveilJ", NumberOfSimulations=10)
# Complete the plot, and add the legend
CEnvelope(Profile, main="Paracou Plots Diversity")
legend("topright", c("Bias Corrected", "Biased"), lty=c(1,3), inset=0.01)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.