## Simple example
dummy_matrix <- matrix(rnorm(500), 100, 5)
## Testing whether the mean of a random subset
## is different than the means of 100 subsets
dummy_test <- randtest.dispRity(dummy_matrix,
subset = sample(1:100, 20),
metric = mean)
dummy_test ; plot(dummy_test)
## Applying this on dispRity objects
data(disparity)
test_disparity <- test.dispRity(disparity,
test = randtest.dispRity)
## The summarised results
summary(test_disparity)
## Plotting the results
plot(test_disparity)
## Applying this on a dispRity object with specific subset comparisons
test_disparity2 <- randtest.dispRity(disparity, subsets = list(
## Comparing subset 90 to the whole population (traitspace)
c(observed = "90"),
## Comparing subset "70" to "90", "70" and "30"
c(observed = "70", random = c("90", "70", "30"))))
## Summarising and plotting the results
summary(test_disparity2)
plot(test_disparity2)
Run the code above in your browser using DataLab