MCMCglmm.subsets {dispRity} | R Documentation |
MCMCglmm.subsets
Description
Creating a dispRity object from a MCMCglmm posterior output
Usage
MCMCglmm.subsets(
data,
posteriors,
group,
tree,
rename.groups,
set.loc = TRUE,
...
)
Arguments
data |
The |
posteriors |
A |
group |
Optional, a named vector of which group to include from the posteriors (if left empty the random and residual terms are used). See details. |
tree |
Optional, the tree(s) used in the MCMCglmm analyses. |
rename.groups |
Optional, a vector of group names for renaming them. See details. |
set.loc |
Optional, if no location is available for a subset ( |
... |
Optional arguments to be passed to |
Details
For the
group
option, the group names must be ones found in theposteriors
formula in the format <Type = Term:FactorLevel> as returned byMCMCglmm.levels(posteriors)
. For example, for returning two random effect, the phylogenetic one ("animal"
) and one for a specific clade (say the 2nd clade) as well as two residual terms for a specific factor (say level 1 and 4) you can usegroup = c(random = "animal", random = "animal:clade2", residual = "units:myfactor1", residual = "units:myfactor4")
.For the
rename.groups
option, the vector must be of class"character"
and must of the same length as the number of random and residual terms inposteriors
or ofgroup
argument (if used). If thegroup
argument is left empty, the groups are extracted from theposteriors
in the following order: the random terms first then the residual terms as specified in theposteriors
object formulas (respectivelyposteriors$Random$formula
andposteriors$Residual$formula
).
NOTE that the output dispRity
inherits the dimensions used in the posteriors
argument. You can always check the selected dimensions using:
data$call$dimensions
Author(s)
Thomas Guillerme
See Also
Examples
data(charadriiformes)
## Creating a dispRity object from the charadriiformes model
MCMCglmm.subsets(data = charadriiformes$data,
posteriors = charadriiformes$posteriors)
## Same but selecting only the three first random terms
MCMCglmm.subsets(data = charadriiformes$data,
posteriors = charadriiformes$posteriors,
tree = charadriiformes$tree,
group = MCMCglmm.levels(
charadriiformes$posteriors)[1:3],
rename.groups = c("gulls", "plovers", "sandpipers"))