DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Create A Multidimensional Matrix.

05.26.2005
| 13236 views |
  • submit to reddit
        Brian Ripley said:

> my.array<-array(0,dim=c(10,5,6,8))

will give you a 4-dimensional 10 x 5 x 6 x 8 array.

Or

> array.test <- array(1:64,c(4,4,4))
> array.test[1,1,1]
> 1
> array.test[4,4,4]
> 64