# NOT RUN {
as_matrix(rray(1:10))
# >2D structures can be coerced to matrices
# their first and second dimensions are
# the only ones having a size >1
x <- rray(1, c(2, 2, 1))
as_matrix(x)
# This cannot be coerced to a matrix
y <- rray_reshape(x, c(2, 1, 2))
try(as_matrix(y))
# }
Run the code above in your browser using DataLab