MCMCglmm.utilities {dispRity}R Documentation

MCMCglmm object utility functions

Description

Different utility functions to extract aspects of a MCMCglmm object.

Usage

MCMCglmm.traits(MCMCglmm)

MCMCglmm.levels(MCMCglmm, convert)

MCMCglmm.sample(MCMCglmm, n)

MCMCglmm.covars(MCMCglmm, n, sample)

MCMCglmm.variance(MCMCglmm, n, sample, levels, scale)

Arguments

MCMCglmm

A MCMCglmm object.

convert

Logical, whether to return the raw term names names as expressed in the model column names (FALSE) or to convert it to something more reader friendly (TRUE; default).

n

Optional, a number of random samples to extract.

sample

Optional, the specific samples to extract (is ignored if n is present).

levels

Optional, a vector "character" values (matching MCMCglmm.levels(..., convert = TRUE)) or of "numeric" values designating which levels to be used to calculate the variance (if left empty, all the levels are used).

scale

Logical, whether to scale the variance relative to all the levels (TRUE; default) or not (FALSE)/

Details

Author(s)

Thomas Guillerme

See Also

MCMCglmm.subsets

Examples

## Loading the charadriiformes model
data(charadriiformes)
model <- charadriiformes$posteriors
class(model) # is MCMCglmm

## Get the list of levels from the model
MCMCglmm.levels(model)
## The raw levels names (as they appear in the MCMCglmm object)
MCMCglmm.levels(model, convert = FALSE)

## Get the traits names from the model
MCMCglmm.traits(model)

## Get all the available samples in the model
length(MCMCglmm.sample(model))
## Get 5 random sample IDs from the model
MCMCglmm.sample(model, n = 5)

## Get one specific samples from the model
MCMCglmm.covars(model, sample = 42)
## Get two random samples from the model
MCMCglmm.covars(model, n = 2)

[Package dispRity version 1.8 Index]