array(data = NA, dim, dimnames = NULL) is.array(x) as.array(x)
is.array returns TRUE if x is an array object (has a dim attribute), and returns FALSE otherwise.
as.array returns x, if x is an array, otherwise a 1-dimensional array with data from x and dim attribute equal to length(x).
# creates a 2 by 4 by 3 array newarray <- array(c(1:8, 11:18, 111:118), dim = c(2,4,3))# creates a 4 by 3 by 50 array from an external file myiris <- array(scan("irisfile"), c(4, 3, 50))