Professional Documents
Culture Documents
Creation of List in R
Creation of List in R
Problem: Using the following informa on given create a list and assess the list for further calcula ons.
Numbers: 25,45,67,89,92,45,64
Profit =238
Aim: To create a list and access the elements from the list.
1. Crea on of list
Procedure:
Use func on list( if two or more values <variable name = c( values)> if single value is given variable
name=<value>)
Procedure:
mylist
$Numbers
[1] 25 45 67 89 92 45 64
$logicals
[1] TRUE FALSE TRUE TRUE FALSE
$Profit
[1] 238
$Names
[1] "Arun" "Varun" "Tharun"
2. To process values in Numbers under mylist
Procedure :
mean(mylist$Numbers)
Result:
61