For matrices a block-diagonal matrix is created. For all other data types he operator is a wrapper of paste.

x %++% y

Arguments

x

First object

y

Second object of same class

Details

Concatenation operator

See also

blockdiag, paste, cat,

Author

Klaus K. Holst

Examples

## Block diagonal
matrix(rnorm(25),5)%++%matrix(rnorm(25),5)
#>             [,1]       [,2]       [,3]       [,4]        [,5]         [,6]
#>  [1,] -0.2357066  1.1519118  1.7579031 -1.0655906  0.26613736  0.000000000
#>  [2,] -0.5428883  0.9921604  0.5607461 -1.5637821 -0.37670272  0.000000000
#>  [3,] -0.4333103 -0.4295131 -0.4527840  1.1565370  2.44136463  0.000000000
#>  [4,] -0.6494716  1.2383041 -0.8320433  0.8320471 -0.79533912  0.000000000
#>  [5,]  0.7267507 -0.2793463 -1.1665705 -0.2273287 -0.05487747  0.000000000
#>  [6,]  0.0000000  0.0000000  0.0000000  0.0000000  0.00000000 -1.539950042
#>  [7,]  0.0000000  0.0000000  0.0000000  0.0000000  0.00000000 -0.928567035
#>  [8,]  0.0000000  0.0000000  0.0000000  0.0000000  0.00000000 -0.294720447
#>  [9,]  0.0000000  0.0000000  0.0000000  0.0000000  0.00000000 -0.005767173
#> [10,]  0.0000000  0.0000000  0.0000000  0.0000000  0.00000000  2.404653389
#>             [,7]       [,8]        [,9]       [,10]
#>  [1,]  0.0000000  0.0000000  0.00000000  0.00000000
#>  [2,]  0.0000000  0.0000000  0.00000000  0.00000000
#>  [3,]  0.0000000  0.0000000  0.00000000  0.00000000
#>  [4,]  0.0000000  0.0000000  0.00000000  0.00000000
#>  [5,]  0.0000000  0.0000000  0.00000000  0.00000000
#>  [6,]  0.7635935 -0.4115108 -0.22426789  0.50360797
#>  [7,] -0.7990092  0.2522234  0.37739565  1.08576936
#>  [8,] -1.1476570 -0.8919211  0.13333636 -0.69095384
#>  [9,] -0.2894616  0.4356833  0.80418951 -1.28459935
#> [10,] -0.2992151 -1.2375384 -0.05710677  0.04672617
## String concatenation
"Hello "%++%" World"
#> [1] "Hello  World"
## Function composition
f <- log %++% exp
f(2)
#> [1] 2