##
## vector -> array
##
as.array3(c(a=1, b=2))
##
## matrix -> array
##
as.array3(matrix(1:6, 2))
as.array3(matrix(1:6, 2, dimnames=list(letters[1:2],
LETTERS[3:5])))
##
## array -> array
##
as.array3(array(1:6, 1:3))
##
## 4-d array
##
# These lines throw an error because the dimensionality woud be 4
# and as.array3 only allows dimensions 3 or less.
# if(!CRAN()) {
# as.array3(array(1:24, 1:4))
# }
Run the code above in your browser using DataLab