View source: R/dispRity.covar.projections.R
dispRity.covar.projections | R Documentation |
Wrapper function for a covar projection analyses on dispRity objects
dispRity.covar.projections( data, type, base, sample, n, major.axis = 1, level = 0.95, output = c("position", "distance", "degree"), inc.base = FALSE, ..., verbose = FALSE )
data |
a |
type |
either |
base |
optional, a specific group to project the elements or the groups onto or a list of pairs of groups to compare (see |
sample |
optional, one or more specific posterior sample IDs (is ignored if n is used) or a function to summarise all axes. |
n |
optional, a random number of covariance matrices to sample (if left empty, all are used). |
major.axis |
which major axis to use (default is |
level |
the confidence interval to estimate the major axis (default is |
output |
which values to output from the projection. By default, the three values |
inc.base |
logical, when using |
... |
any optional arguments to pass to |
verbose |
logical, whether to be verbose ( |
Effectively, the wrapper runs either of the following function (simplified here):
if type = "groups"
: dispRity(data, metric = as.covar(projections.between), between.groups = TRUE, )
for the projections group in data
onto each other.
if type = "elements"
: dispRity(data, metric = as.covar(projections), ...)
for the projections of each element in data
onto their main axis.
If base
is specified:
type = "groups"
will run pairs elements each subset and base
(instead of the full pairwise analyses).
type = "elements"
will run the projection of each subset onto the major axis from base
rather than its own.
A list
of class "dispRity"
and "projection"
which contains dispRity
objects corresponding to each projection value from output
.
The elements of the list
can be accessed and analysed individually by selecting them by name (e.g. output$position
) or by ID (e.g. output[[1]]
).
Alternatively, the list can be summarised and plotted using summary.dispRity
plot.dispRity
.
Thomas Guillerme
projections
projections.between
axis.covar
dispRity
MCMCglmm.subsets
data(charadriiformes) ## Creating a dispRity object with a covar component my_covar <-MCMCglmm.subsets( data = charadriiformes$data, posteriors = charadriiformes$posteriors, tree = charadriiformes$tree, group = MCMCglmm.levels( charadriiformes$posteriors)[1:4], rename.groups = c("gulls", "plovers", "sandpipers", "phylo")) ## Running a projection analyses between groups (on 100 random samples) between_groups <- dispRity.covar.projections(my_covar, type = "groups", base = "phylo", n = 100) ## Summarising the results summary(between_groups) ## Measuring the projection of the elements on their own average major axis elements_proj <- dispRity.covar.projections(my_covar, type = "elements", sample = mean, output = c("position", "distance")) ## Visualising the results plot(elements_proj) ## Visualising the correlation plot(elements_proj, speicfic.args = list(correlation.plot = c("position", "distance")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.