pipeR: Multi-Paradigm Pipeline Implementation

パイプ処理

> library(pipeR)

バージョン: 0.6.0.6


関数名 概略
%>>% Pipe an object forward
Pipe Create a Pipe object that stores a value and allows command chaining with '$'.
pipeR-package The pipeR package
pipeline Evaluate an expression pipeline

Pipe

$で連鎖していくパイプオブジェクトを生成する

> Pipe(rnorm(100))$mean()
<Pipe: numeric>
[1] -0.03378212
> Pipe(rnorm(100))$c(4, 5) []
  [1]  0.462392249 -0.670124511 -2.126407668  0.997879143  0.317176136
  [6]  0.914143918 -1.096991697 -1.258533771  0.752769012 -0.666576206
 [11] -0.622873461  2.417092835  0.229618911 -0.654367195 -0.073948906
 [16]  0.019405512  0.039584004  0.063502091 -0.480403695  0.813702370
 [21] -0.207940868 -2.076749425  0.603240212 -0.265335515  0.796357663
 [26] -0.543130103 -0.860232657  0.278123406  1.417500954 -0.315422198
 [31]  0.883822119  2.509952653  0.628361400  0.063246833  0.775627245
 [36]  0.909109764 -0.439670404 -0.258399679 -0.660616732  0.307178153
 [41]  0.217419708 -0.162985635 -0.118769587 -0.742923429  1.564626065
 [46]  1.142350837 -1.529785833  0.273129604  0.770630979 -0.565028970
 [51]  0.892485296  0.049421596 -1.329318544 -1.549763873 -1.932745501
 [56]  0.491134662  0.134837732 -0.066096025  0.195789645  0.702846944
 [61]  1.689454149  1.341059578  0.967063267  0.885502526  0.911808040
 [66]  1.654363328 -0.407286063 -1.858570046 -1.000046815  0.210664471
 [71]  0.614234288  1.522819629  0.974932034  1.366161828  0.575597797
 [76] -0.889602155  1.566013254  0.230643547 -0.450427422 -0.688455759
 [81]  0.033813960  0.138805611  0.297002682 -0.788285444  1.874167998
 [86] -0.383841180  0.081998547  1.058003079 -1.238339730  0.177059095
 [91] -0.981128571 -0.618397993 -0.072011402  1.127286593 -1.532291110
 [96] -1.820020667 -0.003268389  2.205508815  0.256464317 -0.912808890
[101]  4.000000000  5.000000000
> p <- Pipe(list(a = 1, b = 2))
> p[["a"]]
<Pipe: numeric>
[1] 1
> p[["b"]]
<Pipe: numeric>
[1] 2
> p[length(.)]
<Pipe: list>
$b
[1] 2