Arrays
array- is a “multiply sub scripted collection of data entries” i.e. an array is a sub (inner) set of rows/columns from a bigger set of data entries. A single data entry may have multiple arrays, and subscripts which are subsections of the array
dim(obj name)<- c(#of rows, # of columns, #of arrays)
array(1:z,dim=c(rows,columns) (make sure row*columns=z) or
array(1:z//column1,1:b//column2,dim=c(rows,columns))
dimensional vector- vector of a positive integers, if the variable x is a length k then the array is k dimensional--(i.e. a 1 dimensional array is basically a vector)
matrix- is a 2 dimensional array, there are multiple ways to construct a matrix
Formulas/Ex for Arrays
if b<-1:160, then dim(b)<-c(2,4,20)---in this example, this will create an object of 160 elements, 19 sets of 2 rows, and 4 columns
hint: you do not have to include array information at all (leave space empty) to create a single array
or you can use the array function
objectname[row#,column#]
using the numeric row/column indices, this recalls one element from the data set
objectname[,column#] or objectname[row#,]
this recalls the entire elements in the specified row or column
objectname[,,#of array]
this recalls a particular subscript of data for the object
> z[,,19] [,1] [,2] [,3] [,4] [1,] 145 147 149 151 [2,] 146 148 150 152 >










