Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Introduction to lists
Accessing list elements
Unnamed lists
Working with lists
Summary

Instruction

Good job! With the double-bracket notation, we return one (and only one) list member. If we want to retrieve several members, we use the single-bracket notation – list slicing. We learned how to do this on lists whose members are named, but what about lists with unnamed members? In that case, we simply need to use the c() function and pass in the positions/indexes of the members in the list. For example,

job_role_no_names[c(1, 2)]

will return the first two members of the job_role_no_names list.

Exercise

Extract the profession and languages members from the candidate list. These two members are in the fourth and fifth positions in the list, respectively.

Stuck? Here's a hint!

Use indexes inside the c() function.