Primary exercises
Create and investigate a list.
Three students received different sets of grades (Amy: 1,6,7,9,10; Bob: 6,7,4,3,5,2,2,1,4; Dan: 9,9,10).
In a variablescorescreate alist(the names of the list elements should be the names of the students and the values should be the corresponding grades).
Print the list, itsclass,lengthand structure (str) ofscores.Add an element, change an element.
Reusescoresfrom the previous exercise.
Add there grades for Eve (7,3,5,8,8,9) and print the list.
Then, for Dan merge new grades (8,8,6,7) with the existing grades (hint: use the combine functioncto combine existing Dan’s grades with the new grades then put the result back toscores; do not type again9,9,10).Single and double bracket operators.
Reusescoresfrom the previous exercises.
Investigate the difference betweenscores[[ "Bob" ]]andscores[ "Bob" ].
Look at what is printed and what is the class of each result.
Then comparescores[[ c( "Amy", "Bob" ) ]]withscores[ c( "Amy", "Bob" ) ].
Understand, why the error is reported.Dollar operator.
Reusescoresfrom the previous exercises.
Investigate the (lack of) difference betweenscores$Bobandscores[[ "Bob" ]].
Look at what is printed and what is the class of each result.
Then comparescores$Bowithscores[[ "Bo" ]].
Understand, why theNULLis returned.