View source: R/MCMCglmm.subsets.R

MCMCglmm.subsets | R Documentation |

Creating a dispRity object from a MCMCglmm posterior output

```
MCMCglmm.subsets(
data,
posteriors,
group,
tree,
rename.groups,
set.loc = TRUE,
...
)
```

`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 |

For the

`group`

option, the group names must be ones found in the`posteriors`

formula in the format*<Type = Term:FactorLevel>*as returned by`MCMCglmm.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 use`group = 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 in`posteriors`

or of`group`

argument (if used). If the`group`

argument is left empty, the groups are extracted from the`posteriors`

in the following order: the random terms first then the residual terms as specified in the`posteriors`

object formulas (respectively`posteriors$Random$formula`

and`posteriors$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`

Thomas Guillerme

`dispRity`

`covar.plot`

```
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"))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.