MCMCglmm: Interfaces for MCMCglmm package for data science pipelines.

Description Usage Arguments Details Value Author(s) Examples

Description

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

Usage

1

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
## Not run: 
library(intubate)
library(magrittr)
library(MCMCglmm)


## ntbt_MCMCglmm: Multivariate Generalised Linear Mixed Models
data(PlodiaPO)

## Original function to interface
set.seed(1)
model <- MCMCglmm(PO ~ 1, random = ~ FSfamily, data = PlodiaPO, verbose = FALSE)
summary(model)

## The interface puts data as first parameter
set.seed(1)
model <- ntbt_MCMCglmm(PlodiaPO, PO ~ 1, random = ~ FSfamily, verbose = FALSE)
summary(model)

## so it can be used easily in a pipeline.
set.seed(1)
PlodiaPO %>%
  ntbt_MCMCglmm(PO ~ 1, random = ~ FSfamily, verbose = FALSE) %>%
  summary()

## End(Not run)

Example output

Loading required package: Matrix
Loading required package: coda
Loading required package: ape

 Iterations = 3001:12991
 Thinning interval  = 10
 Sample size  = 1000 

 DIC: -240.0092 

 G-structure:  ~FSfamily

         post.mean l-95% CI u-95% CI eff.samp
FSfamily   0.01023 0.004998  0.01653     1000

 R-structure:  ~units

      post.mean l-95% CI u-95% CI eff.samp
units   0.03404  0.02955  0.03831     1000

 Location effects: PO ~ 1 

            post.mean l-95% CI u-95% CI eff.samp  pMCMC    
(Intercept)     1.163    1.130    1.196     1105 <0.001 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

 Iterations = 3001:12991
 Thinning interval  = 10
 Sample size  = 1000 

 DIC: -240.0092 

 G-structure:  ~FSfamily

         post.mean l-95% CI u-95% CI eff.samp
FSfamily   0.01023 0.004998  0.01653     1000

 R-structure:  ~units

      post.mean l-95% CI u-95% CI eff.samp
units   0.03404  0.02955  0.03831     1000

 Location effects: PO ~ 1 

            post.mean l-95% CI u-95% CI eff.samp  pMCMC    
(Intercept)     1.163    1.130    1.196     1105 <0.001 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

 Iterations = 3001:12991
 Thinning interval  = 10
 Sample size  = 1000 

 DIC: -240.0092 

 G-structure:  ~FSfamily

         post.mean l-95% CI u-95% CI eff.samp
FSfamily   0.01023 0.004998  0.01653     1000

 R-structure:  ~units

      post.mean l-95% CI u-95% CI eff.samp
units   0.03404  0.02955  0.03831     1000

 Location effects: PO ~ 1 

            post.mean l-95% CI u-95% CI eff.samp  pMCMC    
(Intercept)     1.163    1.130    1.196     1105 <0.001 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

intubate documentation built on May 2, 2019, 2:46 p.m.