The “array” Function in R
- Package: Base R (no specific package required) 
- Purpose: Creates an array, a multi-dimensional extension of a matrix. 
- General Class: Data Manipulation 
- Required Argument(s): 
- The data to be used in the array. 
- dim: A vector specifying the dimensions (number of rows, columns, etc.) of the array. 
- Notable Optional Arguments: 
- dimnames: A list with the names for the dimensions. 
- ...: Additional arguments for methods. 
- Example: 
- # Example data for using the array function 
 values <- 1:24
 
 # Create a 3D array with dimensions 2x3x4
 my_array <- array(values, dim = c(2, 3, 4))
 
 # Display the result
 print(my_array)
- In this example, the array function is used to create a 3D array (my_array) with dimensions 2x3x4. The values vector is filled into the array, and the dim argument specifies the dimensions. Arrays in R can have more than two dimensions, providing a flexible structure for organizing and manipulating multi-dimensional data. 
 
                        