Question: Vector selection: the good times ( 4 ) Another way to tackle the previous exercise is by using the names of the vector elements (
Vector selection: the good times
Another way to tackle the previous exercise is by using the names of the vector elements Monday Tuesday, instead of their numeric positions. For example,
pokervectorMonday
will select the first element of pokervector since "Monday" is the name of that first element.
Just like you did in the previous exercise with numerics, you can also use the element names to select multiple elements, for example:
pokervectorcMonday "Tuesday"
Instructions
Select the first three elements in pokervector by using their names:
"Monday" "Tuesday" and "Wednesday" Assign the result of the selection to pokerstart
Calculate the average of the values in pokerstart with the mean function. Simply print out the result so you can inspect it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
