Getting Started with {fibre}
fibre.Rmd
library(phyf)
#>
#> Attaching package: 'phyf'
#> The following object is masked from 'package:stats':
#>
#> pf
library(fibre)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
We start with a phylogeny and some traits we want to model.
fibre uses the phyf package to keep a
phylogeny stored in the phylogenetic flow (pf
) format along
with the data. We will load a premade pf
object for this
example, but later we will see how to make your own pf
object from a phylogeny stored in as an ape::phylo
object.
vert_bmr
#> # A tibble: 1,712 × 8
#> label is_tip phlo lnBMR lnMass lnMass2 lnGS endo
#> <chr> <lgl> <pfc> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 Ornithorhynchus_anat… TRUE ◎── 7…atinus 6.33 6.54 42.8 1.12 1
#> 2 Tachyglossus_aculeat… TRUE ◎── 71.…leatus 6.98 8.05 64.7 1.06 1
#> 3 Zaglossus_bruijni TRUE ◎── 71.…ruijni 7.93 9.24 85.4 NA 1
#> 4 Cyclopes_didactylus TRUE ◎── 71.…ctylus 5.73 5.48 30.0 NA 1
#> 5 Myrmecophaga_tridact… TRUE ◎── 71.…actyla 8.82 10.3 107. 1.46 1
#> 6 Tamandua_mexicana TRUE ◎── 71.…xicana 7.81 8.29 68.7 NA 1
#> 7 Tamandua_tetradactyla TRUE ◎── 71.…actyla 7.83 8.16 66.6 1.41 1
#> 8 Choloepus_hoffmanni TRUE ◎── 71.…fmanni 7.49 8.23 67.8 NA 1
#> 9 Bradypus_variegatus TRUE ◎── 71.…egatus 7.52 8.24 67.9 1.44 1
#> 10 Priodontes_maximus TRUE ◎── 71.…aximus 9.05 10.7 115. 1.50 1
#> # … with 1,702 more rows