# List is a type of storing the data in R which can hold everything vector, array, matrix, dataframe, or multi type data.
list_1 <- list("Manish", 25, TRUE)
class(list_1)



# defining another list_1
list_2 = list(c(1,2,3), matrix(c(5,6,7,8), nrow = 2, ncol = 2), list("Ashish","Brother",27))

# providing name to a list object
names(list_2) = c('Vector','Matrix','list')
list_2['Matrix']

# provide the name while creation of list
list_3 <- list(
                vector = c(23,41,65),
                matrix = matrix(c(45:50), nrow = 3, ncol = 2),
                Array = array(data = (2:13),dim = c(2,2,3)))
            

print(' ')
print('We can fetch the object form a list in two ways')
#1
List_array = list_3[['Array']]
class(List_array)
List_array[,,2]

#2
m =list_3$vector
class(m)
a = list_3$Array
class(a)











Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: