#Create a list containing strings, numbers, vectors, and a logical value.
list_data <- list("red", "green", c(21,32,11), TRUE, 51.23, 119.1)
print(list_data)

#Access the first element of the list.
print(list_data[1])

#Access the third element of the list.
print(list_data[3])

#Give names to the elements in the list.
names(list_data) <- c("1st quarter", "A_Matrix", "A inner list")

#Add elements at same position in the list.
list_data[4] <- "New Element"
print(list_data[4])

#Remove the data from the list.
list_data[4] <- NULL
print(list_data[4])

#Update the element in the list.
list_data[3] <- "Update element"
print(list_data[3])

Embed on website

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