Description Usage Arguments Details Examples
Generates a matrix of species allelic values.
1 |
n |
Number of species. |
het.values |
Range of heterozygote values. |
allelic.range |
Range of allelic values. |
This function provides a simple way to populate a set of phenotypic values for a model community to be used in a simulation of community genetics effects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (n = "number of species", het.values = c(5, 21), allelic.range = c(0,
3))
{
if (n == "number of species") {
n <- 25
}
com <- matrix(NA, nrow = n, ncol = 2)
com[, 1] <- runif(n, het.values[1], het.values[2])
com[, 2] <- runif(n, allelic.range[1], allelic.range[2])
com. <- com
com.[, 1] <- (com[, 1] - 0.5 * com[, 2])/2
com.[, 2] <- (com[, 1] + 0.5 * com[, 2])/2
return(com.)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.