dispRitreats {treats}R Documentation

dispRity interface for treats objects

Description

Pass a treats object to the dispRity function.

Usage

dispRitreats(data, ..., scale.trees = TRUE)

Arguments

data

an output from treats containing tree and traits data.

...

any other arguments to be passed to dispRity, chrono.subsets, custom.subsets, and boot.matrix.

scale.trees

logical, whether to scale the tree ages in all simulations (TRUE; default) or not (FALSE).

Details

This function applies the dispRity package pipeline to the treats output. If multiple simulations are input, the data is scaled for all the simulations.

The scale.trees option allows the trees to have the same depth and root age. This option is recommended if chrono.subsets options are called to make the output results comparable.

Common optional arguments for the following arguments include the following (refer the the specific function for the arguments details):

Value

Outputs a "dispRity" object that can be plotted, summarised or manipulated with the dispRity package.

Author(s)

Thomas Guillerme

See Also

treats dispRity chrono.subsets custom.subsets boot.matrix plot.dispRity summary.dispRity

Examples

## Simulate a random tree with a 10 dimensional Brownian Motion trait
my_treats <- treats(stop.rule = list("max.taxa" = 20),
                    traits    = make.traits(BM.process, n = 10),
                    bd.params = make.bd.params(speciation = 1))

## Calculating disparity as the sum of variances
disparity <- dispRitreats(my_treats, metric = c(sum, variances))
summary(disparity)

## Calculating disparity as the mean distance from the centroid of
## coordinates 42 (metric = c(mean, centroids), centroid = 42)
## using 100 bootstrap replicates (bootstrap = 100) and 
## chrono.subsets (method = "continuous", model = "acctran", time = 5)
disparity <- dispRitreats(my_treats,
                          metric = c(mean, centroids), centroid = 42,
                          bootstraps = 100,
                          method = "continuous", model = "acctran", time = 5)
plot(disparity)

## Simulate 20 random trees with a 10 dimensional Brownian Motion trait
my_treats <- treats(stop.rule = list("max.taxa" = 20),
                    traits    = make.traits(BM.process, n = 10),
                    bd.params = make.bd.params(speciation = 1))

## Calculating disparity on all these trees as the sum of variance
## on 5 continuous proximity time subsets
disparity <- dispRitreats(my_treats, metric = c(sum, variances),
                          method = "continuous", model = "proximity", time = 5)
plot(disparity)


[Package treats version 1.0 Index]