R Array

Array

An Array is the R data object that can store data in more than two dimensions

CODE/PROGRAM/EXAMPLE
str(array)
	function (data = NA, dim = length(data), dimnames = NULL)
  • data: the data to create an array
  • dim: the dimensions of the array
  • dimnames: the row & column names
Syntax
ary <- array(data = 1:24, dim = c(3,4,2))
	print(ary)

Output:

array output in r language

In the example shown, dim=c(3,4,2) represents 3 rows, 4 columns and data to be divided into 2 arrays

#array_in_r_language #array_in_r_programming #r_programming_array #r_language_array #define_array_in_r #array_r_programming

(New page will open, for Comment)

Not yet commented...