| dispRity.covar.projections {dispRity} | R Documentation |
Covar projection analyses wrapper
Description
Wrapper function for a covar projection analyses on dispRity objects
Usage
dispRity.covar.projections(
data,
type,
base,
sample,
n,
major.axis = 1,
level = 0.95,
output = c("position", "distance", "degree"),
inc.base = FALSE,
...,
verbose = FALSE
)
Arguments
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 ( |
Details
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 indataonto each other.if
type = "elements":dispRity(data, metric = as.covar(projections), ...)for the projections of each element indataonto their main axis.
If base is specified:
-
type = "groups"will run pairs elements each subset andbase(instead of the full pairwise analyses). -
type = "elements"will run the projection of each subset onto the major axis frombaserather than its own.
Value
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.
Author(s)
Thomas Guillerme
See Also
projections projections.between axis.covar dispRity MCMCglmm.subsets
Examples
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")))