#Accessing List Elements: 
# Create a list of a vector, a matrix and a list: 
list_data <- list(c("Jan","Feb","Mar"),
matrix(c(3,9,5,1,-2,8), nrow = 2), list("green",12.3))

# Name the elements in the list:
names(list_data) <- c("1st Quarter", "A_Matrix", "An Inner list")
             
#Accessing List Elements
# Access the first element of the list: 
print(list_data[1])

# Access the 3rd element (which is also a list):  
print(list_data[3])

# Access the list element using the name of the element:
print(list_data$A_Matrix)
             
# Merging Two Lists
# Create two lists and merge them:
list1 <- list(1,2,3)
list2 <- list("Sun","Mon","Tue")
merged.list <- c(list1,list2)

# Print the merged list: 
print(merged.list)
