rでfold
Reduceという関数がある。
> Reduce(paste, letters) [1] "a b c d e f g h i j k l m n o p q r s t u v w x y z"
- '...'引数は無いので、使いたければ無名関数を経由する。
> Reduce(function(x, y)paste(x, y, sep="/"), letters) [1] "a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z"
Reduceという関数がある。
> Reduce(paste, letters) [1] "a b c d e f g h i j k l m n o p q r s t u v w x y z"
> Reduce(function(x, y)paste(x, y, sep="/"), letters) [1] "a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z"