R Under development (unstable) (2024-09-10 r87115 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(abind) > x <- array(1:4, dim=c(2, 2), dimnames=list(X=c('a','b'), Y=c('d','e'))) > y <- array(5:8, dim=c(2, 2), dimnames=list(W=c('A','B'), Z=c('D','E'))) > # dimname names not used unless use.dnns=T > abind(x, y) d e D E A 1 3 5 7 B 2 4 6 8 > abind(x, y, along=1) D E a 1 3 b 2 4 A 5 7 B 6 8 > abind(x, y, use.dnns=T) Z W d e D E A 1 3 5 7 B 2 4 6 8 > abind(y, x, use.dnns=T) Y X D E d e a 5 7 1 3 b 6 8 2 4 > abind(y, x, use.dnns=T, use.first.dimnames=T) Z W D E d e A 5 7 1 3 B 6 8 2 4 > abind(x, y, use.dnns=T, use.first.dimnames=T) Y X d e D E a 1 3 5 7 b 2 4 6 8 > abind(x, y, along=1, use.dnns=T) Z W D E a 1 3 b 2 4 A 5 7 B 6 8 > abind(y, x, along=1, use.dnns=T) Y X d e A 5 7 B 6 8 a 1 3 b 2 4 > abind(y, x, along=1, use.dnns=T, use.first.dimnames=T) Z W D E A 5 7 B 6 8 a 1 3 b 2 4 > abind(x, y, along=1, use.dnns=T, use.first.dimnames=T) Y X d e a 1 3 b 2 4 A 5 7 B 6 8 > > proc.time() user system elapsed 0.10 0.06 0.17