prepareSider: Matching phylogenies and data frames

Description Usage Arguments Value See Also Examples

View source: R/prepareSider.R

Description

Matches phylogenies and data into a mulTree object.

Usage

1
2
prepareSider(data.estimate, data.isotope, tree, isotope,
  random.terms = ~animal + species + tissue)

Arguments

data.estimate

data for species to be imputed (see recipeSider).

data.isotope

a data.frame containing isotope data. If missing the isotope_data dataset will be used.

tree

a phylo or multiPhylo object.

isotope

the isotope for which discrimination factor is to be imputed, either "carbon" or "nitrogen".

random.terms

an object of class formula describing the random effects. By default the random terms are "~ animal + species + tissue". Note that "animal" designates phylogeny in MCMCglmm.

Value

A mulTree object.

See Also

recipeSider, combined_trees, isotope_data, as.mulTree.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Load the combined trees data
#data(combined_trees)

## Initialise the data in the right format
new.data.test <- recipeSider(species = "Meles_meles", habitat = "terrestrial", 
   taxonomic.class = "mammalia", tissue = "blood", diet.type = "omnivore", 
   tree = combined_trees)

## Load the isotope data
#data(isotope_data)

## Generate the mulTree object to be passed to imputeSider()
tdf_data_c <- prepareSider(data.estimate = new.data.test,
   data.isotope = isotope_data, tree = combined_trees, isotope = "carbon")

healyke/DEsiR documentation built on April 19, 2020, 7:14 p.m.