covar.utilities {dispRity} | R Documentation |
Utilities for a dispRity object with covariance matrices
Description
Different utility functions to extract aspects of a MCMCglmm
object.
Usage
get.covar(data, subsets, sample, n, dimensions)
axis.covar(data, subsets, sample, n, dimensions, level = 0.95, axis = 1)
Arguments
data |
a |
subsets |
optional, a |
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). |
dimensions |
optional, which dimensions to use. If missing the dimensions from |
level |
which confidence interval level to use (default is |
axis |
which major axis to calculate (default is |
Author(s)
Thomas Guillerme
See Also
Examples
## Load the Charadriiformes dataset
data(charadriiformes)
## Making a dispRity object with covar data
covar_data <- MCMCglmm.subsets(data = charadriiformes$data,
posteriors = charadriiformes$posteriors)
## Get the two first covar matrices for each level
get.covar(covar_data, sample = c(1,2))
## Get 2 random covar matrices in 2D for each level
get.covar(covar_data, n = 2, dimensions = c(1,2))
## Get mean covar matrix for each level
get.covar(covar_data, sample = mean)
## Get the 0.95 major axis for the 42th covar matrix
axis.covar(covar_data, sample = 42)
## Get the 0.5 major axis for 2 random samples
axis.covar(covar_data, n = 1, level = 0.5)
## Get the median 0.95 minor axis of the 2D ellipse
axis.covar(covar_data, sample = mean, dimensions = c(1,2), axis = 2)
[Package dispRity version 1.8 Index]