caper: Interfaces for caper package for data science pipelines.

Description Usage Arguments Details Value Author(s) Examples

Description

Interfaces to caper functions that can be used in a pipeline implemented by magrittr.

Usage

1
2
3
4

Arguments

data

data frame, tibble, list, ...

...

Other arguments passed to the corresponding interfaced function.

Details

Interfaces call their corresponding interfaced function.

Value

Object returned by interfaced function.

Author(s)

Roberto Bertolusso

Examples

 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)

rbertolusso/intubate documentation built on May 27, 2019, 3 a.m.