Description Usage Arguments Details Value Author(s) Examples
Interfaces to caper
functions that can be used
in a pipeline implemented by magrittr
.
1 2 3 4 | ntbt_brunch(data, ...)
ntbt_crunch(data, ...)
ntbt_macrocaic(data, ...)
ntbt_pgls(data, ...)
|
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | ## Not run:
library(intubate)
library(magrittr)
library(caper)
## ntbt_brunch: Calculate a linear model using the brunch algorithm
data(perissodactyla)
perisso <- comparative.data(perissodactyla.tree, perissodactyla.data, Binomial)
## Original function to interface
brunch(log.female.wt ~ Territoriality, data = perisso)
## The interface puts data as first parameter
ntbt_brunch(perisso, log.female.wt ~ Territoriality)
## so it can be used easily in a pipeline.
perisso %>%
ntbt_brunch(log.female.wt ~ Territoriality)
## ntbt_crunch: Calculate a linear model using the crunch algorithm
data(shorebird)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species)
## Original function to interface
crunch(Egg.Mass ~ F.Mass + M.Mass, data = shorebird)
## The interface puts data as first parameter
ntbt_crunch(shorebird, Egg.Mass ~ F.Mass + M.Mass)
## so it can be used easily in a pipeline.
shorebird %>%
ntbt_crunch(Egg.Mass ~ F.Mass + M.Mass)
## ntbt_macrocaic: Comparative analysis using independent
## contrasts on species richness data
data(IsaacEtAl)
primates <- comparative.data(primates.tree, primates.data, binomial, na.omit=FALSE)
## Original function to interface
macrocaic(species.rich ~ body.mass, data = primates)
## The interface puts data as first parameter
ntbt_macrocaic(primates, species.rich ~ body.mass)
## so it can be used easily in a pipeline.
primates %>%
ntbt_macrocaic(species.rich ~ body.mass)
## ntbt_pgls: Phylogenetic generalized linear models
data(shorebird)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species, vcv=TRUE, vcv.dim=3)
## Original function to interface
pgls(log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), shorebird, lambda='ML')
## The interface puts data as first parameter
ntbt_pgls(shorebird, log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), lambda='ML')
## so it can be used easily in a pipeline.
shorebird %>%
ntbt_pgls(log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), lambda='ML')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.