VOOZH about

URL: https://www.geeksforgeeks.org/r-language/convert-list-to-array-in-r/

⇱ Convert list to array in R - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Convert list to array in R

Last Updated : 1 Sep, 2021

A list can be converted to array in R by calling unlist( ) function with created list as parameter. Now pass the unlist() function into array() function as parameter, and use dim attribute for specifying number of rows, columns and matrices. unlist() converts list to vector.

 Syntax : 

array( unlist( list_variable ) , dim = ( rows ,columns , matrices ))

Given below are various implementation for the same:

Example 1 :

Output :

👁 Image

Example 2 :

Output:

👁 Image

Example 3 :

Output:

👁 Image
Comment

Explore