Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Selecting elements from a list Your list will often be built out of numerous elements and components. Therefore, getting a single element, multiple elements, or
Selecting elements from a list
Your list will often be built out of numerous elements and components. Therefore, getting a single element, multiple elements, or a component out of it is not always straightforward.
One way to select a component is using the numbered position of that component. For example, to "grab" the first component of shininglist you type
shininglist
A quick way to check this out is typing it in the console. Important to remember: to select elements from vectors, you use single square brackets: Don't mix them up
You can also refer to the names of the components, with or with the $ sign. Both will select the data frame representing the reviews:
shininglistreviews
shininglist$reviews
Besides selecting components, you often need to select specific elements out of these components. For example, with shininglist you select from the second component, actors shininglist the first element When you type this in the console, you will see the answer is Jack Nicholson.
Instructions
XP
Select from shininglist the vector representing the actors. Simply print out this vector.
Select from shininglist the second element in the vector representing the actors. Do a printout like before.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started