Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Introduction to lists
Accessing list elements
Unnamed lists
Working with lists
26. Adding member in unnamed list


Great job! If your list doesn't contain member names, you can still add new members using the double-bracket operator and an appropriate index. For example, if the job_role_no_names list contains three elements, we can define a new member like this:

job_role_no_names[[4]] <- "18 applicants"
This denotes how many people applied for the data scientist position.


Now, you know that job_role_no_names contains four elements.

What would happen if you were to try to add a new member in the 10th position? Will R throw an error? Try to execute the template and observe the results. What do you see?